In the spirit of the Logic Pro - Macro Megathread (2022) started by @noisneil, I thought it would be helpful to create a similar thread for the Keyboard Maestro Editor.
Please use this thread to contribute macros that you use with the Keyboard Maestro Editor. Alternatively, if a macro has been contributed elsewhere in the forum, please add a link to it; optionally add your comments.
No macro is too simple; if you find it handy to use, please share it here.
I will contribute the first one: Search All Macros.
If you’d like to format your entry as I’ve done below, here are the steps:
-
Using Heading 2 enter MACRO:, the macro name, and the version. For example,
## MACRO: MacroName, v1.0
-
Optionally include a macro description or any related comments.
-
Include a screenshot or animated GIF (if applicable). (Note that you can copy a screenshot and paste it into the forum editor; the editor will generate the markdown for the copied screenshot.)
-
Add the macro download link.
<mark>(the download link)</mark>
-
Place the image markdown within a folding section. For example:
<details><summary>Macro-image</summary> ![Keyboard Maestro Export|593x4048, 75%](upload://ti3lOZCB1hjPk52UhXpur8Ch4zP.jpeg) </details>
MACRO: Search All Macros, v6.0
I have a large macro library and I search often. Using the keyboard only, this macro makes it easy to use search qualifiers that I find particularly helpful.
Download: Search All Macros.kmmacros (84.7 KB)
Documentation
PURPOSE
The Keyboard Maestro Editor Search field supports powerful macro searching, but it can be a bit tedious the enter the search string in the field. This macro presents a dialog that can be used to build and enter a search string in the Search field.
In addition, the dialog includes two additional buttons:
-
Clear Search : The Search field will be cleared, the macros will be sorted by Name, and Reveal Parent Group will be selected.
-
Wiki: Search Strings : The Keyboard Maestro wiki page for Search Strings will be opened. This page is lists other Qualifiers that can be used when searching for macros.
RUNNING THIS MACRO WITH PARAMETER
If this macro is run from another macro using the Execute a Macro action (or via AppleScript), and With Parameter is specified, the value will be deciphered via this macro’s %TriggerValue%. There are two options:
-
If
<Clear Search>
is specified, the dialog will be bypassed, but the macro will function as if the dialog Clear Search button had been selected. -
If it includes a 0: prefix, the dialog will be bypassed, and the text that follows 0: will be used as the search string. For example, if With Parameter is 0:used:1m, the dialog will be bypassed and used:1m will be the search string. If it does not include a 0: prefix, the values will used as the initial value in the dialog box.
TESTED WITH
• Keyboard Maestro 11.0.3
• Sonoma 14.5 (23F79)/MacBookPro18,2
• Sonoma 14.5 (23F79)/VariableMacBookPro16,1
• Mojave 10.14.16/Macmini6,2
• High Sierra 10.13.6/iMac11,1445
VERSION HISTORY
1.0 - initial version
1.1 - Bug fix. Incorrect smart quotes replaced with dumb quotes.
1.2 - Centers the dialog.
2.0
a) Added a field for Additional Qualifiers.
b) Dialog notes improved.
c) Dialog can be dismissed using the esc key.
d) Inexplicably, extraneous characters sometimes appear in the Search field when the Find in All Macros… menu item is selected. The macro will now delete such characters.
3.0 If this macro is run from another macro using the Execute a Macro action (or via AppleScript), and With Parameter is specified, the value will be deciphered via this macro’s %TriggerValue%. If it includes a 0: prefix, the dialog will be bypassed, and the text that follows 0: will be used as the search string. For example, if With Parameter is 0:used:1m, the dialog will be bypassed and used:1m will be the search string. If it does not include a 0: prefix, the values will used as the initial value in the dialog box.
3.1 To prevent Search using Regular Expression spurious errors in the Engine.log, added an If Then Else. The visible function of the macro was not changed.
3.2 Now restores the System Clipboard.
4.0
a) If a value is selected from the used: dropdown menu, the search results are sorted by Date Used. Otherwise, they are sorted by Name.
b) Changed the ‘Additional Qualifiers’ logic to be more forgiving.
c) Bug fix: Occasionally when was pressed to dismiss the main dialog, it would not close.
5.0
a) Added created: and modified: qualifiers.
b) When building the search string, now using the short version, e.g, mod: rather than modified:.
c) When sorting, added a check to determine if the menu item is active. This eliminates some clutter from the Engine.log.
6.0
a) If the name checkbox is selected, the search search will include a n: prefix (previously it was name:).
b) Added a Clear Search dialog button. If selected the Search field will be cleared, the macros will be sorted by Name, and Reveal Parent Group will be selected.