A quick way to search for macro groups?

My Macro groups are growing like weeds! And it’s increasingly difficult to find the right one!

Is there a way to quickly search for macro groups like I can with macros (by using the “Trigger macro by name“ action (After typing in the macro i was looking for → press option + enter → bring you right to that macro in KM editor))

I can make a macro for that with, ahem, scripting, but I still need to sleuth out the other project of yours. :wink:

1 Like
  1. Use AppleScript to get Group UUIDs and names in KM's "friendly list" format
  2. "Prompt with List" using the result from step 1
  3. "Open URL" using the KM URL Scheme and the result from step 2
  4. There is no step 4...

Go To Macro Group.kmmacros (2.9 KB)

You could also use AS to select the Group in the Editor but a) this is a good chance to show KM's URL Schemes, and b) I'd hate to be thought of as a one-trick pony :wink:

2 Likes

Brilliant. Just want to mention that if you want to edit an individual macro instead of a macro group, you can do that by changing the fragment (get every macro group) into (get every macro).

Note that this list is much longer (at least in my case) so the prompt does not show any suggested values until the time you start typing, making the list of suggested values shorter.

1 Like

Don't forget that you can ⌃⌘M in the Editor to "Go to Macro" -> "by Name..." -- which is probably quicker.

2 Likes

True, but that only works when you are already in the editor. Using the applescript will open the editor if needed.

For me, and regardless of whether the Editor is already open, the AppleScript route takes 2-3 seconds longer than the simple:

...and I suspect the difference increases the more macros you have.

As always, YMMV.

1 Like

Splendid!! This works great! THank you!

For me the Apple script (for macro groups) take just about 0.2 seconds.

If I change the fragment (get every macro group) into (get every macro)like @fap suggested, it takes 1-1.5 seconds

It will depend on the number of macros you have in total,

1 Like

And also the speed of your computer. You need to compare the speeds of the AS and KM "native" versions on your machine -- comparing your time against mine just lets you laugh at how slow my iMac is :wink:

IIRC, Apple said the M4 had twice the single-core performance of the i9, so you halving my times seems right.

1 Like