Macro Failure as a Trigger

Is it possible to do some action, when my macro fails. For example to bring a finder window to the front. Thank you!

To my knowledge, no. But every KM action that could cause a macro to fail can be checked for failure.

If you want to be able to check if an action failed, follow these steps:

Click the "gear" icon for the action (1), and uncheck the two "checked" items shown here (2):

Then look at the token %ActionResult%. It will contain "OK" if the previous action succeeded. So you test for failure like this:

If you want to display the contents of %ActionResult%, then you need to save the value of %ActionResult% first, otherwise its value will change. Like this:

I hope this helps.

1 Like

I don’t know of a trigger, but if you observe an error (like one of the brief error notifications), then you can use this macro to quickly get more info:

MACRO: [KM] Display Macro Error

1 Like

Technically, the ActionResult value is only updated when an action ends so you can do this:

Because the If action has not ended, it has not changed the ActionResult token, and so it is still available for the Display Text action. At the end of the Display Text action, the ActionResult would be set to OK (and then again at the end of the If action).


Awesome! It seems obvious now that you explained it - of course it hasn’t been modified yet. Obvious or not, thanks for the explanation!

1 Like