Simple debug: "If fail, open failed macro in keyboard maestro"

a redeeming quality about iOS shortcuts: when they fail, you can often tap to open that shortcut and edit it.

This does the same.

Use case: you have a macro that runs on a certain website, but every few months, that website changes and breaks your macro. I'm using it after several "click found image" actions.

Put the group pictured after those "likely to break" actions:

it will execute the macro (attached), which opens the failed macro.

Install this:
Debug (open) this macro.kmmacros (1.7 KB)

Save this as a favorite, so you can append to any likely-to-fail macros:
Save this group as a favorite.kmmacros (4.3 KB)

3 Likes

Great! There's also this:

Display Most Recent Error.kmmacros (51 KB)

Macro screenshot

It's a manually triggered macro that will take you to the most recently failed action.

1 Like

The "Go To Failed Action" contains the following definition:

/Users/noisyneil/Documents/- MY DOCUMENTS/Keyboard Maestro Stuff/Compiled Scripts/KM Global/Display Most Recent Error/Go To Failed Action.scpt

Without the script it will not do much I guess.

Just switch the action to text script.

That solved the problem. Thanks.

1 Like

I used to have a habit of offloading scripts as files in an attempt to reduce KM's library size. Since getting a new mac, I haven't needed to, so I forgot to switch that one back. Sorry about that.

You don't need to set a variable, you can do it all in the "Open URL" field:

image

Similarly, it's a tad more efficient if you put that action into your Favourited Group rather than calling it in a sub-macro.

There are, of course, reasons why you might want to save the macro UUID to a persistent Global variable. And you may want to have the sub-macro for organisational reasons, or perhaps you plan to have more than just the "Open URL" action in it. So my way isn't "right" -- as so often in KM there's more than one way to do something and the "right" way is the one that works best for you!

1 Like