Jump to content
Macro Express Forums

Repeat until.....keypress?

Recommended Posts

Macro1 initiated by mouse click, toggles a variable between 0 and 1, runs Macro2 when toggling from 0 to 1.


Macro2 checks variable toggled by Macro1. If variable=0, stop. If variable=1, do the keystrokes, run Macro2 (i.e. restart itself), stop.


So the first mouse click will fire off the operation, which will continue "forever" with Macro2 running then immediately restarting itself. Second mouse click will trigger Macro1 to run again (between iterations of Macro2) and flip the variable back to 0, so on its next iteration Macro2 will terminate itself.


I think the above will work. You may have to "save" the variable at the end of each macro, and "restore" it at the beginning of each, so that each macro will see what the other has done.

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.

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.

  • Create New...