How To Stop a Specific Instance of a Running Macro

Just like entering a hotkey to start a macro, I want to know how to enter a hotkey to stop only certain macros, not all macros.

ex) [shift+a] start the macro, [shift+v] stop this macro. not other macro
ex2) Stop when hotkey is pressed once more

-This sentence has been translated from Korean

You can stop a specific instance of an executing macro with the Cancel a Specific Macro action.

Example 1:

Macro Doit, Trigger Shift-A

Macro Cancel Doit, Trigger Shift-V

Example 2:

Macro Doit, Trigger Shift-A

  • If variable DND_Macro Doit is not empty
  • else
    • Do stuff
    • Set variable DND_Macro Doit to text β€œβ€

To handle the case where the macro fails or aborts for other reasons and so DND_Macro Doit is not cleared, you could go a little further and validate whether %Variable%DND_Macro Doit%, when it is not empty, is or is not in ExecutingInstances token. But probably this is not necessary, since the only result would be that pressing Shift-A in this case would β€œcancel” the already not running macro, and then pressing it again would start it.


Thx. I couldn't follow along perfectly, but got a big hint. And succeeded.
Thank you a lot. :smiley:

-This sentence has been translated from Korean

1 Like