KM Group Action to Handle Script Error

###MACRO:   KM Group Action to Handle Script Error

~~~ VER: 1.0    2017-02-26 ~~~

####DOWNLOAD:
KM Group Action to Handle Script Error.kmmacros (5.1 KB)


###ReleaseNotes

PURPOSE:

  • Check for, and handle, an error returned by the last "Execute Script" Action.
  • The Script MUST return either "[ERROR]" OR "[USER_CANCELED]" at the beginning of the script results, IF the script had an error, or if the user canceled a dialog in the script.

USAGE

  • Place this Group Action IMMEDIATELY after your Execute Script Action.
  • The Execute Script Action MUST return results to a KM Variable. If you are not using the results for other purposes, you could just name the variable "ScriptResults".
  • You MUST change the "Set variable ScriptResults" action to use the KM Variable that your script returns:
    .

    .
  • I keep this Group Action in my KMFAM Actions, which makes it very easy to find an use in new macros.
  • This may seem like a lot, but I keep the Group Action collapsed, so it does not intrude much.