Subroutine to Get List of All Macros and IDs in a Specific Macro Group

thanks very much ! What about the many "get list" macros that I created and have been using. Should I rewrite them all ?

No - leave all of those alone.

What you need to do now is replace the contents of the original subroutine by the contents of the updated subroutine.

To do that follow these steps:

  1. For clarity, let's call the original version of the subroutine sub-v1

  2. And call the new version of the subroutine sub-v2

  3. Open sub-v1 in the KM editor

  4. Click on the first action (the Comment) to select it

  5. Then select all the actions using A

  6. Now delete them all by pressing the Delete key and you will be left with just the barebones of sub-v1 like this

  7. Now download and install the new version sub-v2 into KM by double clicking in Finder on the file you just downloaded

  8. Open sub-v2 in the KM editor (it will be disabled - leave it that way)

  9. Click on the first action (the Comment) to select it

  10. Then select all the actions using A

  11. Now copy them all into the clipboard by pressing C

  12. Open the (now empty) sub-v1 macro in the KM editor

  13. Paste the contents of the clipboard into the empty sub-v1 macro using V

  14. The old sub-v1 macro now contains all the actions of the new sub-v2 macro

  15. Delete the (disabled) sub-v2 macro - it has no further use.

By replacing the contents of the old subroutine with the contents of the new one you have preserved all the "get list" macros you have created.

And I apologise if I've offended you by giving you baby-steps to follow :baby_bottle: - I just want to be clear...

As with anything potentially destructive - make a backup of your macros before trying this. Even though the procedure works here on my Mac doesn't mean mistakes can't happen :wink:

Let us know how you get on.

1 Like

Working on it. Extremely kind of you to give detailed instructions. Very much appreciated.
I will give you a follow-up

I followed your instructions and all must have gone well because my other "get list" macros work.

As far as the smart groups are concerned, I am confused:

I chose to test with my smart group "Help Macros" which lists all macros pertaining to help

In the image below,
1- filled in correctly ?
2- I can choose a smart group but contrary to normal macro groups, I can only select individual macros, not the complete smart macro group
3- there is no option to select a smart macro group

thanks again very much

  1. Looks like it's OK as long as you have a group or smart group called "Help Macros".

2+3 smart macro groups are not like ordinary macro groups and you're quite limited in terms of what you can do with them. I hardly use them myself so all I can do is point you at the KM wiki entry manual:Smart Groups [Keyboard Maestro Wiki] remembering that a macro in a SMG is not actually in that group but instead satisfies the SMG's search criteria.

So maybe given what you want SMGs are not so usable?

Sorry if not very helpful :person_shrugging:

1 Like

you are extremely helpful and ... a genius !

@tiffle this is great, thank you! Do you know if there is a parameter for the assigned keyboard shortcut that could be pulled into the output?

Hello Shawn (@SDM):wave:

Even though I am not @tiffle - what you are asking for is not possible with this Subroutine…

This Subroutine is designed to return Macros alongside their UUID‘s which belong to a specific Macro Group.

To extract a Keyboard Shortcut that’s assigned to a Macro you’ll have to write something that will work with selected Macros.

Maybe it could be done when writing the bits for that particular task and adding it to the Subroutine but this would be a lot of work.

You would have to get every Macro out of that group to first determine if it has a trigger, then if it is a Hot Key Trigger - and if that’s true extract the TriggerXML part out of the particular Macro and compare the Key Codes of the XML to a full set of Key Codes to get the actual Hot Key for the Macro - and then for the last Part adding it as String to the output (the UUID and the Macro Name).

I doubt that this would happen any time soon.

Greetings from Germany :de:

Tobias

As @Nr.5-need_input says, the subroutine isn't geared up for that.

Instead, you might want to look at this How List Active KM Macros With Their Keyboard-Triggers? and incorporate the solution for that with this subroutine in order to achieve what you're asking.

If this is way off the mark you might want to explain why you need this as there may be other, better approaches to getting what you want.

EDIT:
Another topic that I didn't link to because it didn't provide a solution has just been updated by @ComplexPoint to include a macro that's worth looking at. Check it out here: List Macros With HotkeyTriggers - #5 by ComplexPoint

1 Like

Hello Taj

Thanks for replying and reminding me of a nifty little AppleScript from Chris (@ccstone) I almost had forgotten it existed…

I hope you’re doing well.

Greetings from Germany :de:

Tobias

1 Like