I wish the "Run" button in the Editor would pause first

When you are editing a macro and you click the 'Run' button at the top of the Editor, the macro runs immediately. This is done intentionally, as the " How to Run a Macro" section of the Manual's "Macro" page says

You can try out a macro from the Keyboard Maestro by clicking the :arrow_forward:︎ Run button at the top of the editor window. Of course, macros are often sensitive to the context, so it may not be appropriate to run them directly from the editor.

I find that it is almost always inappropriate, and therefore not very useful.
In contrast, the "Click at Found Image" action has a "Get" button (for actions that are not relative to the Found Image) that pauses for 5 seconds before running, so that you can get into the correct context.
It would be great if the 'Run' button did the same thing.

How would the Editor know if you wanted to run the macro immediately or with a pause first? I suppose you could Option-click the Run button for a 5 second pause...

You could create a favorite action for easy insertion at the top of each macro:

Run with pause option.kmmacros (4.1 KB)

This seemed to work in my testing: Hold down the Option key, and Run takes effect after five seconds; don't hold it down, and it runs immediately.

If you always want the delay, just get rid of the second IF and put the Pause as the only action for when the token contains Editor.

(Yes, I realize it'd be nice to have this as a Keyboard Maestro feature, but this workaround seems to work.)

-rob.

7 Likes

So simple it's beautiful -- nice one, @griffman!

3 Likes

Another option is to use KM's progress bar to visual show the pause. Just add this at the beginning of the macro you want to have a pause. Pause progression can be customized.

Macro Pause Macro (v11.0.3)

Macro Pause.kmmacros (4.0 KB)

1 Like

WOW!
Thank you for the fantastic answer.
I didn't know about %Trigger%.
And I wonder if I ever could have found out about this in the help wiki.
In particular, I searched for the word "editor" on the help pages for Triggers, token/Trigger, token/TriggerBase, token/TriggerValue, manual/Macro_Triggers, and it doesn't appear.