patgenn123 Posted December 18, 2007 Report Share Posted December 18, 2007 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 Quote Link to comment Share on other sites More sharing options...
jason Posted December 18, 2007 Report Share Posted December 18, 2007 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... Quote Link to comment Share on other sites More sharing options...
patgenn123 Posted December 19, 2007 Author Report Share Posted December 19, 2007 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 Quote Link to comment Share on other sites More sharing options...
kevin Posted December 19, 2007 Report Share Posted December 19, 2007 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 Quote Link to comment Share on other sites More sharing options...
patgenn123 Posted December 19, 2007 Author Report Share Posted December 19, 2007 Thanks Kevin and Jason! Shucks! I appreciate the explanation, but wish there was a simpler way than using logic "if..then.." statements. It'll take forever to do it with 50 folders. I know I could use prompt also. Just wanted to avoid all that. Thanks! Pat Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.