MACRO: Quit the KM Engine or Cancel All Macros? (v1.1)



PURPOSE

When using Keyboard Maestro, there have been times when my mac has become nearly impossible to control:

  • The Keyboard Maestro engine inexplicably caused the mac to become extremely sluggish.

  • During macro development, I introduced a logic error that caused repeated actions in a tight loop.

For the former case, I’ve found that quitting and restarting the Keyboard Maestro Engine solves the problem. For the latter case, cancelling all macros generally solves the problem.

This macro provides a method to recover for either senario. Note that the square, beginning at the upper-left corner (→↓←↑), mouse gesture trigger is included because there are times when the mac is not responsive to the keyboard and mouse clicks. Note: It seems that a mouse gesture trigger is most consistently triggered when the mouse movement is at medium speed.

TESTED WITH

• Keyboard Maestro 10.1.1
• Monterey, v12.4/MacBookPro16,1
• Mojave 10.14.16/Macmini6,2
• High Sierra 10.13.6/iMac11,1445

VERSION HISTORY

1.0 - Initial version
1.1
a) Changed the mouse gesture trigger to a square beginning at the upper-left corner. The previous gesture, ↓↑↓, caused too many unintended triggers.
b) The Continue with No Change dialog button subsequent notification can be surpassed with the Option key (⌥).


DOWNLOAD Macro File:
Quit the KM Engine or Cancel All Macros?.kmmacros (27 KB)
Note: This macro was uploaded in a DISABLED state. It must be ENABLED before it can be run. If it does not trigger, the macro group might also need to be ENABLED.

Macro-image

Hey Jim,

While this macro is a fine idea I recommend that you also have a Kill All Macros! macro tied to a single keyboard shortcut.

Mine is K which is programmed into my muscle-memory and has saved my bacon a few times.

If things really go south you cannot be assured your dialog will appear at all or that its attached keyboard shortcuts will work.

-Chris

2 Likes

@ccstone, thanks for adding that comment. I have a similar single-action macro; I should have mentioned that. My hot key trigger is ⌃⌥⇧⌘- (a.k.a. Hyper & -).


Macro-image


Interestingly, in the former case, my system has become so slow that the keyboard and mouse clicks are not recognized or only recognized after a lengthy (>1min) delay*. Fortunately mouse movement has still been responsive, thus I included the mouse gesture trigger; but because this could be accidentally triggered, I added the dialog for confirmation. Note also that the dialog includes a 30-second timeout—useful in the event the keyboard and clicks are unresponsive.

*Note that the KM Engine problems have not been eliminated, but I've had fewer problems since recently abandoning macro syncing.

Aside: It was a bit tricky to define mouse gestures. After several recording attempts I was able to generate a →↓←↑ (a rectangle) mouse gesture, but during testing I couldn't get it to be reliably detected—when attempting to trigger the macro. The current trigger ↓↑↓ was easier to record and has been easier to use.

If there's anyone out there that has regularly used mouse gesture triggers, I'd appreciate any tips you might have.

1 Like

What about reactivating the macros - after their cancellation?

Restart KM ?

/OmarKN

Hi @okn; it depends...

If macros are cancelled, they can be restarted using the configured triggers (hot keys, etc.). So nothing special in this case.

If the Keyboard Maestro Engine is stopped, it can be restarted two ways:

  1. In the Keyboard Maestro application (a.k.a., the editor), select File > Launch Engine.
  2. Close the Keyboard Maestro application and restart it. (BTW, the automatic restart of the engine can be bypassed if ⌃⌥⇧⌘ are pressed when the Keyboard Maestro application is restarted.)

I've updated the OP with Version 1.1 of Quit the KM Engine or Cancel All Macros?:

  • Changed the mouse gesture trigger to a square beginning at the upper-left corner. The previous gesture, ↓↑↓, caused too many unintended triggers.
  • The Continue with No Change dialog button subsequent notification can be surpassed with the Option key (⌥).