Cancel / Kill All Running Macros

Hey Folks,

Do you have a Kill-Switch for all running macros?

I do, because I once nearly hosed my entire $HOME folder with a macro I was working on.

My Kill-Switch is:


It’s a keyboard shortcut I won’t ever hit by accident – is mnemonic – and is quick to access.

I also use the Iconaholic Loud Status Menu Icon, so it’s UNMISTAKABLE when Keyboard Maestro is running a macro.

If you don't have such a thing then hurry up and install the macro below.

At least once this Kill-Switch has saved me from doing major damage to my system.

One day I was editing an often used macro and got interrupted several times in fairly quick succession.

When I got back to my computer I reflexively hit the keyboard shortcut for the macro (which normally is entirely benign).

It was really one of those “OH, CRAP!” moments when I saw the Keyboard Maestro status menu flashing repeatedly at me and slammed the panic button. (The status menu should only have blinked if things were working normally.)

If I hadn’t quickly caught-on to the problem it I would have wiped out my entire $HOME folder – as it was I lost nearly all of my ~/Downloads folder – tens of gigabytes of curated stuff I didn't want to lose...

Normally I have checks that prevent untoward things like that from happening.

Normally I would have disabled that macro before leaving the computer.

But it was one of those days, and the panic button really saved my bacon.

Another possible problem the Kill-Switch can rescue you from is a macro that accidentally (or intentionally) takes control of your keyboard and mouse and prevents any user input.

I did this once myself by accident.

I later downloaded a macro that took over my Mac without my permission, and this is one reason why Keyboard Maestro disables all imported macros by default.

I didn't have my Kill-Switch to rescue me then, and I had to force-shut-down my Mac.


Kill All Running Macros v1.00.kmmacros (5.8 KB)
Keyboard Maestro Export

Tags: @kill, @switch, @cancel, @macro, @ccstone


Man I’m just impressed that you can easily hit all those modifiers and the K key at the same time. Or maybe you use a hyper key. I tried using a hyper key with BTT but it was horribly unreliable.

My kill key combo is something I can hit with just my left hand since my right rarely leaves the trackpad.

@cdthomer you also do not have to :wink:

I have taken the KM AppleScript of the macro in BTT and then start this with a three finger click on the Trackpad.


I start my KM macros 90% of the time via BTT Mouse or Trackpad gestures.

I use a similar macro attached to my F11 key because I often write macros with such serious bugs that I can't even move the mouse anymore.

However before I wrote that "F11-kill-all" macro, there were times when I had lost control of the GUI and couldn't "kill all" because the mouse was no longer controllable. I probably decided to do a hard power down. But what I could have done then was use one of the keyboard shortcuts that STARTS a macro and press that button 25 times (I think now you have to start it 50 times) and with that many copies of the macro running the KM engine will abort all macros, and I will have control of the mouse once again.

So basically you don't need a "kill all" macro because all you have to do is press a "start macro" button 50 times (as long as the macro doesn't finish.)

Once again this is an example of a "wrong way" to solve a problem. But it should work.

I use Cmd+F19 on my extended keyboard. F19 is easy to hit because it's at the end of the keyboard. And my thumb is usually resting right below the Cmd key. So when I'm panicking and need to "kill them all", it requires very little thinking on my par, which is good.



Since macOS already uses . for cancel this seemed like super cancel!