Select/Trigger Macro by Name Only [Macro:KM10]

Purpose: Add "name:" label to Macro search popup to quickly search by macro name only.

Current behavior of following will search both name and content of macros that match the search string

  • [Select Macro by Name] selector (View -> Select Macro -> By Name...)
  • [Trigger Macro by Name] action

So if you want to search by "name" only, you need to prefix search term with "name:" eg name:java to show list of macro names that contain that term.

Solution:
What these macros do is just to add this "name:" prefix so that you can immediately type the search term. This is done by calling a macro function with defined delay(in second) (adjust delay according if needed to) to insert the prefix.

This only work in Keyboard Maestro Editor.

Tip: You can also assign the macro "Select Macro By Name Only" using the same shortcut key [⌃⌘M] as the menu item in "Select Macro By Name" so to make it act like default.

Why not just set the prefix in Initial Search string in [Trigger Macro by Name] action ? Setting this will cause the prefix to be selected, so typing the macro name will replace it, hence require delayed prefix insertion.

The function macro allow two ways to insert the prefix 'name:" :

  • By delay (Default)
    Delay will depend on how fast the macro list is displayed, and thus varies with number of macros. But generally work reliably.
  • By Image Detection (use the KM icon show in popup)
    Image detection is faster however need to be tweaked to work reliably.

Adjust the delay or capture the KM icon show in popup and change them in GREEN action


Macro: [EKM] Func: Select/Trigger Macro by Name Only => Insert name label


Macro: [EKM] Select Macro By Name Only


Macro: [EKM] Trigger Macro By Name Only


a_KM = KBM Macros.kmmacros (31.4 KB)

2 Likes