User Tools

Site Tools


token:ActionResult

**This is an old revision of the document!**

ActionResult Token

Value Returned

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

  • If 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)

token/ActionResult.1469059712.txt.gz · Last modified: 2016/07/20 20:08 by JMichaelTX