Is there a way to cancel just this macro if a key is pressed anytime during execution?

I have a macro that triggers the interactive screenshot (cmd shift ctrl 4) and then Pauses until clipboard changes and then after some more actions it pauses for another condition later.

Now I don't know what action should I add so that if I pressed an assigned hotkey anytime during the macro it cancels just this macro.

If then else doesn't seem to work because once it has checked for key down then doesnt care if it's pressed at a later time.

You cannot cancel just a specific macro, so what I would probably do is make a macro that is something like this:

  • Trigger on whatever key you like
  • Cancel All Macros

Disable this macro.

Then in your macro, at the start, use the Enable Macro action to disable it, and then at the end, use the action to disable the macro. So the macro is active only during the execution of your original macro.

The trigger for your cancelation macro can probably be anything, even something simple like Escape or Space Bar, or whatever, since it is only active during your macro.

1 Like

Awesome. Sounds like a good solution but with one problem.
I have a timer macro that runs to track how much I studied today. (I think it has code written by you). If I cancel all macros then I am worried that the timer macro might get disturbed

That is true. Unfortunately, there is no way to kill a specific instance of a macro execution, except manually, since there is no way to specify which macro execution instance to kill.