KM Troubleshooting

The log is a great debugging tool—and you can make it even more helpful by using the Log action to add your own entries—mark when your macro enters and exits certain sections, record values of variables, etc.

When I'm working on something complicated, I use this simple macro quite often:

Download Macro(s): Tail the log.kmmacros (29 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

That runs the tail command on the log, which shows (in real time) entries as they get added to the log. I position the Terminal window so I can see it while the macro runs, and then can see what happens as it happens. When done, Control-C ends the tail command.

EDIT: Also, this thread is useful; it explains how to select the action related to an Action ID in the log that threw an error. I used it to write a very simple macro that asks for the action ID number, then uses the AppleScript line Peter showed to jump to that action.

-rob.

1 Like