PURPOSE
This macro opens the most recently executed macro in the Keyboard Maestro Editor.
Alternatively, if triggered using the secondary hot key, the one that includes Shift (β§), the 14
most recently executed macros are listed in a Prompt With List. (The default value is 14
because this number of macros vertically fills the Prompt With List menu; however, the default value can be optionally changed using the local_SecondaryTrigger_NoEntries variable.)
When the Prompt With List is displayed, the selected macro is opened in the Keyboard Maestro editor. Alternatively, if Shift (β§) is held down when the macro is selected, the macro is executed.
EXECUTING THIS MACRO FROM ANOTHER MACRO AND/OR BY USING APPLESCRIPT
If this macro is run from another macro using the Execute a Macro action (or via AppleScript), and With Parameter (WP) is specified, the macro runs as follows:
WP | Behavior |
---|---|
null | run in normal mode, i.e., the most recently executed macro is opened |
>1 | the integer number of macros are included in the Prompt With List. Again, the selected macro can be edited or executed. |
SETTINGS
local_SecondaryTrigger_NoEntries : refer to the PURPOSE section above.
local_RegexPatterns_MacrosToExclude : can be optionally configured to exclude macros. The value can be one or more text lines, each a regular expression pattern. For example:
^_
[Uu]ntitled
macros that begin with underscore (_
) or include Untitled
or untitled
are excluded. Note that
^%ExecutingThisMacro%$
^%ExecutingMacro%$
are automatically excluded.
ACKNOWLEDGEMENTS
This macro uses JXA shared by @ComplexPoint (N most recently run macros (Name, UUID, Stats)) that extracts data from Keyboard Maestro Macro Stats.plist
. Minor modifications were made to provide compatibility with Keyboard Maestro v10+.
TESTED WITH
β’ Keyboard Maestro 11.0.3
β’ Sonoma 14.6.1 (23G93)/MacBookPro18,2
β’ Sonoma 14.6.1 (23G93)/VariableMacBookPro16,1
β’ Mojave 10.14.16/Macmini6,2
β’ High Sierra 10.13.6/iMac11,1445
VERSION HISTORY
1.0 - initial version
EXAMPLE PROMPT WITH LIST
When using the secondary trigger (or called with a With Parameter), a Prompt With List similar to the following will be displayed.