Find a Macro by Its UUID

When I try to find a macro by UUID, all that I find is the macro that is using the UUID to call the macro, not the macro itself.
Currently using version 7. It seems like you at one time, with an earlier version of KM you could the macro being called by using it's UUID in the search field. So now I have macro's that call other macro's but I have no idea what they are since I can't find them by their UUID.

And yes... I would not be in this situation if I took the extra time to comment.

See this KM Wiki article: Tokens for Macros

New tokens were added in KM 7.2 to address your issue.

Not sure how that helps me do a search for a specific macro using it’s UUID. That looks way more advanced that what I use KM for. I mostly just use KM to launch applescripts. And it is from within some of those Applescripts that I call Macro’s by UUID.

Sorry, I’m not clear on your objective.
If you could upload/post your macro and script that you are having trouble with, it will help us help you. Please be specific about what is not working, and the behavior you expect/want.
See How to Post/Upload Your Macro to the Forum

I am not having trouble with a Macro Itself. It is nothing more than some Applescript that runs within the macro under “Execute Applescript”

Here is an example of one of my Macro’s.

tell application "Safari"
   set theWindow to the front window
   set theTab to the current tab of theWindow
   set theURL to the URL of theTab
   
end tell

if theURL contains "pinterest" then
   tell application "Keyboard Maestro Engine"
      do script "73EE9B1A-1211-411B-AF82-6895E82CDA6D"
      set hasRun to true
   end tell
end if
if theURL contains "ebay" then
   tell application "Keyboard Maestro Engine"
      do script "EC50C497-D317-4658-83D1-0ACCC27A33CF"
      set hasRun to true
   end tell
end if

What I am trying to do is find out is what exactly are the two KM Scripts that I am calling are.

I used to be able to just paste in the UUID (EC50C497-D317-4658-83D1-0ACCC27A33CF) into the KM Editor search field on the top right of the window and it would find whatever script had the UUID of “EC50C497-D317-4658-83D1-0ACCC27A33CF”, but now it only finds the macro that is calling it.

I want to be able to search for “EC50C497-D317-4658-83D1-0ACCC27A33CF” and find that it is a macro that resides in my “Safari Only” exception folder and it’s name is “eBay script”. Problem is that I have no idea what the actual name of the macro is.

This will get you the Macro Name in AppleScript:

tell application "Keyboard Maestro Engine"
  set myUUID to "6A007297-D6DC-4550-8088-7517AD2096EF" ### Put  YOUR UUID here
  set macroToken to "%MacroNameForUUID%" & myUUID & "%"
  set myMacroName to process tokens macroToken
end tell

You can use this token to get the Macro Name for its UUID:

https://wiki.keyboardmaestro.com/token/MacroNameForUUID

That worked!!!! Not as easy as a simple search, but I'll take it.

Note to self... always comment your code!

Thanks!!!

You can also use this, from Safari:

keyboardmaestro://m=

and this from AppleScript:

tell application "Keyboard Maestro"
	editMacro "DA4F4B78-912D-44C1-BF38-8A23ACC066A2"
end tell
1 Like

In addition, you can use this macro, which I just published based on Dan's work, to easily open the KM Editor to the macro for the UUID:

[KM] Reveal Macro and Group From UUID

Yes, it is a bug in Keyboard Maestro, sorry. If you search for the UUID with just the last component (everything after the last -) it should work and will likely find only the one you are after.

Fixed for the next version.

2 Likes

Hey Chris,

Remember that you can call macros by name with do script as well as by UUID.

That said – I usually use UUID, because you can have macros with duplicate names.

-Chris