Inspired by @DanThomas’ question “Is there a key to ‘try’ the current macro?”.
While editing a macro I frequently click the Try button (or ⇧⌘T) to test the macro.
What then happens, very often, is that the KM Editor runs an action instead of the whole macro. Of course, this happens because I still had the last edited action selected.
This happens especially when I had selected a nested action and then scrolled out of view and hit ⇧⌘T.
To my knowledge — in this case the only way to try-run the macro (instead of a selected action) is to…
- select any top-level action (clicking, or repeatedly ⌃⌘← ‘Parent Action’) and then…
- hit either ⌘A or ⌥⌘A (Select all or Deselect All) and then…
- hit ⇧⌘T to try-run the macro.
(When the selected action is a nested action ⌘A or ⌥⌘A alone will not work, because the reference system for ‘(De)Select All’ seems to be the nesting level/group.)
This macro does the three steps above with a single key stroke (for example F1).
For running only the currently selected action (not the macro) you can do so by long-pressing F1. (‘Parent Action’ and ‘Deselect All’ will be bypassed.)
(You may want to experiment with the Pause value. On my machine the macro is slow enough to make an explicit pause unnecessary.)
You can also invert the condition to F1 is down
so that a short press runs the selected action and a long press runs the macro.
If you are used to the built-in key ⇧⌘T you can use it as trigger instead of F1. Just change the key in the condition too.
Note: The macro will not be able to run a macro if an action is selected and KM’s window focus is in the ‘Macros’ list column. But the Try button (or ⇧⌘T) won’t do either. I haven’t found a way to shift the focus back to the editing view. (May be possible with AppleScript.)
→ See update in post below ↓
Update (2016-07-08): See post below ↓