*[NOTE: This is enhanced version of the original one at [Go to Recent Failed Macro Action [Macro:KM10]]. This is bit complicated, so if your need is simple, the original version is suffice, but if you want more bit convenient, this version is better. The reason why I want to build a second version is because I find it useful to have a two line error messages, ability to open KM Log and show Last recent Failed Macro action information]
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. )
- Display two lines: The first line is the failed action line, and the second line may shown the error description (otherwise just ignore the second line)
- Shortcut-Key trigger at Top Screen Edge will open KM Engine Log file Console app.
- Shortcut-Key trigger at Right Screen Edge will show the recent failed macro action in dialog box.
Note: If need the error message text to be larger in Display Large Text Action, put a lower value for MAX_WIDTH in the JXA Action