Go to Recent Failed Macro Action [Macro:KM10]

[Note: There is enhanced version at [Go to Recent Failed Macro Action v2 [Macro:KM10]] that add additional error line, ability to open KM Log etc. I keep this original simplified version as it is.]

Remember those times where macro failed and aborted leaving you scratching your head of what went wrong ? So you open up the KM log file and check for the recent failed action. This manual checking is quite tedious especially if macro has many actions and you need to figure out which action is actually causing the error. So you probably end up calling logging, debugging or display action to trace the failed action.

But no more, KM10 has added this valuable feature "Select Last Aborted Action"
View -> Select Last Aborted Action
to immediately highlight the specific action in the macro that fails.

The following is the macro that upon trigger, open up the KM Editor and call "Select Last Aborted Action" to highlight the failed action while displaying the failed action description so to quickly pinpoint the source of error. (Note that this macro should be used immediately after the error occur because KM Log file and "Aborted Action" may have changed if the macro is used later. )


[EXP] Go to Recent Failed Macro Action .kmmacros (5.8 KB)

1 Like

This looks very handy. So I think I'll use it.

I'll probably just type it in myself rather than download it, because it will make me think. One change I might make is that while your second action is a good/safe/defensive action to ensure no errors, I find that it's better to wait for the menu item (e.g., the one that appears in your third action) appears, because some apps actually have delay between when they are activated and when their menus become visible. So I guess what I would change it to (or add to your macro) would be this:


1 Like

Good idea. Have changed that.

Thanks. You don't need to take any of my advice, but I would probably also add a semaphore that aborts the macro for simultaneous invocations since this macro could be started multiple times by the user and the pause condition doesn't seem to have a timeout. There's no need for multiple occurrences of this macro to exist simultaneously.

Yes it does – it's just low on the gear/contextual menu.

Even so the semaphore is a good idea.

What I meant was that the pause condition in the macro didn't have a timeout.

I'll just leave this version as is as it is simplified version.

I have developed an enhanced version that shows two error message lines.