RDT Posted December 23, 2008 Report Share Posted December 23, 2008 I have a macro and want to set it up with a repeat command. The amount of times I process the macro will change each and every time I run it. I want to run it and have it abort any time the Esc key is hit. What is the best way to handle this? Thanks in advance for your help. Quote Link to comment Share on other sites More sharing options...
stevecasper Posted December 23, 2008 Report Share Posted December 23, 2008 I have a macro and want to set it up with a repeat command. The amount of times I process the macro will change each and every time I run it. I want to run it and have it abort any time the Esc key is hit. What is the best way to handle this? Thanks in advance for your help. Unfortunately, there is no way to tell your macro to stop the repeat by using a key-press. You can abort the macro with the Abort Macro hot-keys (you can see what they are under Preferences > Playback, I believe). Sometimes ESC does work to abort a macro, but only when there is a dialog or prompt on the screen. And that would cancel the whole macro, not just the repeat. That's not to say what you want to do isn't possible. I have dozens of macros that have repeats that need to keep repeating until specific conditions are met. One option you have is to set a prompt each time the repeat is supposed to start. That way you can tell it how many times to repeat each time you run the macro. Like this: Repeat Prompt Start (Prompt for repeat count at macro play time) Text Box Display: Bulk of Macro Here Repeat End If you don't know before-hand how many times it's going to need to go, you may need to figure out a different way for the macro to "see" that it's time to end the repeat. Have the macro "look" for something in the process... probably the same thing you yourself would look for to know it is time to end the repeat. This could be anything from specific text, Window title, color of a particular area of the window, etc. In which case the repeat section of the macro would look more like this: Repeat Until %T1% <> %T1% If Message: "Requirements Met" Break Else Text Box Display: Bulk of Macro Here End If Repeat End <REP3:08:000002:000001:0001:1:01:T1><IFMESS3:00000:1:1:Requirements MetIf requirements met, end repeat, otherwise keep going.Center:Center><BREAK><ELSE><TBOX4:T:1:CenterCenter000278000200:000:Bulk of Macro Here><ENDIF><ENDREP> 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.