Find action in current macro by UID [SOLVED]

Sometimes when a macro completely or partially fails and I go to the Engine log, I can easily identify which action is causing the issue, but that's not always easy. Especially if it's a complex macro and some actions are very similar such as Shell / Applescript actions that slightly differ. I noticed that the log identifies the action by a number (called integer in the XML), which seems to be called UID such as this:
2024-05-19 14:04:58 Action 15442125 failed

How can I create a macro that does that automatically and give me the name of the action? I could select all actions, copy that selection as XML, paste it to a text app and find the number, then checking the name above it.
I'm sure there's a way to automate this?

A related discussion:

Can I determine a Macro UUID from an Action UID? - Questions & Suggestions - Keyboard Maestro Discourse

1 Like

Thank you! Jim's simple script was exactly what I needed!
I believe I saw someone sharing a more complex macro focused on the Engine Log's messages and I think one of the features was that it would show the action and macro names... but I don't remember who shared it and where that post is.
For now this simple script is more than enough.
Thanks for sharing

I use a simplified version of that first AppleScript in the thread @ComplexPoint linked to, but with a wrapper around it to help automate it (and make sure I have an Action ID selected):

Download Macro(s): Show action for matching Action ID.kmmacros (34 KB)

Macro screenshot

Macro notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.
System information
  • macOS 14.4.1
  • Keyboard Maestro v11.0.2

I select the Action ID in the log (in whatever app I happen to be using to see the log file), then run the macro. The macro copies the selection, makes sure it's an ActionID (or at least just a pure number), then runs the AppleScript to select that ID and activate Keyboard Maestro.

-rob.

1 Like

That'll also be @_jims here:

1 Like

Coincidentally, I'm about to share v8.0 of Engine.log Tool. After a little more testing, I'll post it.

One enhancement within v8.0, thanks to the help of @ComplexPoint, will be to display the macro associated with the failure/timeout.


The new version of Engine.log Tool will include several other improvements.

5 Likes

Yes, that's exactly what I was looking for. Thanks!

1 Like

Thank you for this tool, Jim!

You're welcome, @alltiagocom. I have completed testing and posted Version 8.0.