Hi,
I have recorded an action with my mouse, and now the action "takes" my mouse and go crazy in a loop as soon as i open KM. I have to hard shut down my Mac to stop KM because it's impossible to stop the macro with the mouse mooving by itself.
Is there any shortcut to disable all macros when opening KM without using the mouse? Or anything i can do to prevent this to happen when i open the app? I just want to open KM and delete the last action i did in a macro to be able to continue working on it!
Thank you,
François
Hello @Francois_Leclerc ,
For this you have to do something like:
- Build a Macro with the
Cancel all Macros - Action
and add a HotKey Trigger to it. Please Note this will cancel EVERY Macro.
- Write A script for the Script Menu or FastScripts to quit Keyboard Maestro Engine like this:
property ptyScriptName : "Quit Keyboard Maestro Engine"
property ptyScriptDate : "Thursday, 3rd June 2021"
tell application "Keyboard Maestro Engine" to quit
- Save the Script as compiled
.scpt
File in your global Scripts Directory under ~/Library/Scripts/
The next Time when something happens like you described execute the Macro, wait until all macros are canceled and then Execute this Script.
Now you should be able to open Keyboard Maestro Editor to Edit the Macro.
After that you only have to reenable Keyboard Maestro Engine manually.
Hope this helps
Good Luck
Greetings from Germany - and stay safe
Tobias
Good lesson learned here. Always provide an "escape" for any macro (program) that can be in a tight loop and become a runaway.
Here's a macro that shows how to do this with KM.
==Just hold down all modifier keys ⌘⌃⌥⇧ to STOP the macro==.
You can put the first two actions in any Macro where you want an escape.
Be sure to change this Action to the Name of whatever macro you use this Action in:
![image](https://forum.keyboardmaestro.com/uploads/default/original/3X/3/6/36db1f9228574a165785d692fa15631594af1817.png)
Below is just an example written in response to your request. You will need to use as an example and/or change to meet your workflow automation needs.
Please let us know if it meets your needs.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MACRO: How To Provide ESCAPE (Disable) For Runaway Macro [Example]
-~~~ VER: 1.0 2021-06-02 ~~~
Requires: KM 8.2.4+ macOS 10.11 (El Capitan)+
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))
DOWNLOAD Macro File:
How To Provide ESCAPE (Disable) For Runaway Macro [Example].kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.
Yes, thank you very much for your fast reply!
François
Excellent idea! I have that exact macro.
When you open the KM Editor, it automatically will start the KM Engine if it is not running.
@peternlewis, can the KM Editor be started without starting the Engine?
See the wiki Troubleshooting Run-Away Login Macros.
Yes. Launch the Keyboard Maestro editor app without starting its Engine by holding all the modifiers down ⌘⌃⌥⇧ (that's Cmd-Control-Option-Shift) while launching the editor, either by clicking the Keyboard Maestro Editor app in the Mac Doc, or double-click the app in the Applications folder.
2 Likes