User Tools

Site Tools


token:ActionResult

ActionResult Token

The %ActionResult% token returns text indicating the success or failure of the immediate past action.

If the immediately past action was successful, then “OK” is returned, otherwise, a message describing the reason for failure is returned.

How To Use

Note that this value is reset at the end of every action, so immediately after the Action, you must save the %ActionResult% token into a variable, or use it in a control flow action, like a If/Then Action.

You can use this token for error handling, much like a traditional try/catch/on error construct. But you have to build your own test immediately after the action. Keyboard Maestro will not throw an error in most cases.

Examples

Example #1

  • Action that Might Fail
    • You may need to disable (uncheck) the Action Option for “Timeout Aborts Macro”
    • You may want to change the timeout interval in the Option for “Set Action Timeout…”
  • Set Variable “Reason” to text %ActionResult%

Example #2

  • Action that Might Fail
  • If Text %ActionResult% is “Whatever”

Example #3

Test if the Copy Action failed due to timeout (likely due to no selection)

See Also


Actions

Tokens

Manual

Forum

Action Result, Action Results, Action Failure, Action Success

token/ActionResult.txt · Last modified: 2021/10/14 05:06 by peternlewis