Is There a Way to Just Cancel the Last Triggered Macro?

Hear me out.
There are a few circumstances where i need to cancel the macro I just triggered (these have pause conditions)
I was thinking there must be a way to set escape key as a hotkey for a generic macro that basically just cancels the most recent macro triggered?

Why do I need this, because of the Pause conditions a lot of times my macros run later on when condition becomes true.

Thanks in anticipation.

See How do I cancel a running Macro?.

You can cancel all running macros by holding all the modifiers (Control, Option, Shift and optionally Command) and clicking on the Keyboard Maestro Status Menu Icon.

You can cancel a specific macro by choosing Cancel from the Status Menu menu and selecting the macro. This is also a useful way of seeing what macros are currently running, if any.

You can also see and cancel macros by choosing Start Debugging from the Status Menu menu.

And finally, you can use the Cancel All Macros, Cancel Other Macros, Cancel This Macro, or Cancel Just This Macro actions.

1 Like

It would be great if you could provide a hotkey for this.
I know we can cancel ALL macros with a hotkey, but when something wrong is happening, and you want to just cancel the last macro, it takes way too long to go through the KM Status menu. We'd tried automating this with UI scripting, but there is a huge delay (~6 sec) after the Status menu is displayed before we can click on the errant macro.


That is what You can cancel all running macros by holding all the modifiers (Control, Option, Shift and optionally Command) and clicking on the Keyboard Maestro Status Menu Icon. is for.

What hot key would I use? It would have to be global, available in all applications, not conflict with anything, and you would have to know it when required. So if you want one, set one up, you have more chance of remembering it than if I make a choice.

I guess you missed this part:

Well, you could do like many, many other apps (BBEdit comes to mind), and allow the user to set these type shortcuts in the app preferences.



Script Debugger



Even Evernote gives us some control, and they hate preferences almost as much as you do. :wink:

If Evernote can figure this out, it must be easy. :wink:

Or, all else failing, if you could fix the status menu so that it does not have a delay, then we could script it ourselves.

Of course, you could make KM Actions for these (cancel last macro prior to this one) and let use assign whatever hotkey we want.

Many, many ways to skin this cat. :smile:

If “something wrong is happening” why would you not want to just cancel everything?

There is no delay in clicking with all the modifiers. There is no need to even open the status menu.

Smash all the modifiers down and click the status menu. There is no delay in this.

Why would I add another preference when you can make the macro yourself?

If you want a hot key, make a hot key. That's what Keyboard Maestro is for after all.

Hey @forums2012,

Everyone who uses Keyboard Maestro should have a keyboard-driven Kill-All-Macros Macro.

I have mine bound to K, which is very, very fast for me to activate.

Hey @peternlewis – I don't see a way to cancel a specific macro from another macro with either a Keyboard Maestro action or via AppleScript.

If I'm missing something please enlighten me – otherwise please think about adding that as a feature.


That is correct. In part because there would be no way of specifying a specific instance of an executing macro.

Oh, yeah. I can see that.