If Prior Step Fails, Execute Next Step

Iā€™m trying to get Microsoft Outlook 365 on my Mac to use Command-L to mark a message both as Unread and as Read. Problem is, you canā€™t use the Keyboard Shortcuts menu as you can for most other apps on the market to accomplish this. So I turned to Keyboard Maestro.

Problem here is: I give KM two macros, one for unread and one for read, and it freaks out. So now Iā€™m trying to have just one macro that executes when I press Command-L and if one string fails, the other will execute (i.e. if the message is ā€œreadā€ and I want it to mark as ā€œunread,ā€ Maestro will first try and fail to execute ā€œMark as Read,ā€ and will then revert to ā€œMark as Unread.ā€) Iā€™ve fiddled with the If/Then Else macro, but Iā€™m failing. Any insight?

Thanks!

p.s. I did review the thread called ā€œOn Step Failure Jump to Stepā€ but I found it remarkably confusing.

You can use the KM ActionResult Token to determine if an Action failed. If it is NOT "OK", then it failed.

1 Like

JMichael!

Thanks so much for the quick reply - I tried fiddling with the ā€œActionResult Token,ā€ but I canā€™t figure out how to integrate it into the ā€œIf/Then Elseā€ in such a way to help me.

Fortunately, I resolved the issue with a weird/unexpected work around.

I created a ā€œMark as Unreadā€ Macro and have it set to select the menu item ā€œMark as Read,ā€ with an ā€œIf/Then Elseā€ condition that refers to itself: if the ā€œMark as Unreadā€ macro is inactive, then execute nothing, but if otherwise, execute the following actions: "select menu item ā€œMark as Unread.ā€

Not really sure why it works, but it does.

To get better help, please post your macro.
See

That's a "good news/bad news" story. :wink:
It may work for now, but you don't know if it will have unintended consequences. Best to find a solution that you do understand.

The Select or Show a Menu Item action accepts alternatives directly in the action, ie:

Mark as Unread|Mark as Read

1 Like

Peter!

This is AWESOME! It very clearly solves the problem. And I definitely would have never thought of that on my own.

JMichael - I agree. I will need to figure this out. But with Peterā€™s solution, Iā€™ll wait for another fire before investing the time.

You guys are great!