Jump to content
Macro Express Forums

Shortkey


patgenn123

Recommended Posts

I know I could type a word anywhere on the screen and a macro could be triggered from a shortkey, but what if I want to trigger a macro base on a %T1% variable? Could this work?

 

What I am trying to do it have a folder pop up based on the folder name, but it's completely random. What would be the best way to do this with a shortkey?

 

Thanks for the help!

 

Pat

Link to comment
Share on other sites

Without more information, it is difficult to say exactly what to do, but you could try having it paste the necessary information to the clipboard, assign it to %T1% and then do an if variable contains command to tell the macro what to do next.

 

if variable T1 = My Documents

Open Folder: My Documents

end if

if variable T1 = My Computer

Open Folder: My Computer

end if

 

etc...

Link to comment
Share on other sites

Is there any way to have a shortkey place the shortkey itself into a variable? For example, if the shortkey is "abc", I'd like the first command in the macro to assign what was imputed into %T1%.

 

Is this the same as assigning it to the clipboard as you mentioned? How could something be assigned to a clipboard as text if it cannot be assigned to a variable?

 

Shortkeys confuse me. What if I put %T1% in the shortkey property field. What next? What limits would there be to the variable and how could I bring variable values back into %T1%?

 

Kind of perplexed...

 

Pat

Link to comment
Share on other sites

Each macro consists of a way to activate it and the commands to run once it is activated. You can use variables in the script of the macro but you cannot use variables in the activation. If you have a macro that you activate by typing <prefix>abc or abc<suffix> (depending on your shortkeys properties) then it will activate a single macro.

 

Is there any way to have a shortkey place the shortkey itself into a variable?
Since each shortkey activates a single macro, no. You can put a macro command such as Variable Set String as the first line in your macro. Or use a Text Type command to reenter the 'abc' portion.

 

You could create several shortkey macros and have them all call another common macro using the Macro Run command.

Variable Set String %T1% "abc"
Macro Run: Your main macro

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...