OnExit: run another script or display a MsgBox upon main script termination
Tag: OnExit
A script from another file/job or from a variable in the current script can be executed, or a message displayed, after the main script ends.
Tag Attributes
Attributes | Attribute Values | Value Description |
---|---|---|
User Definable | The external script file path and name to be used. | |
User Definable | The variable to be used. NB: here the variable name must be used without the variable syntax {% and %} <OnExit ExecuteVar=”VarName”/> is OK <OnExit ExecuteVar=”{%VarName%}”/> is NOT OK | |
MsgBox | User Definable | The message to display after the script ends. |
MsgBox, Execute and ExecuteVar are not mutually exclusive.
When a combination is set, the sequence is:
MsgBox
Execute
ExecuteVar
When set in an OnExit action, Execute and ExecuteVar indicate which automation directives to run after the script ends. The exit actually triggers a regular Execute / ExecuteVar call.
Example Script
<ytriaAutomation>
<SetVar MyVar="USE_CDATA" BypassVar="true">
<![CDATA[ <SetVar Exit1="var 1"/>
<MsgBox Message="ON EXIT EXECUTEVAR: {%Exit1%} {%Exit2%}!"/>]]>
</SetVar>
<OnExit executeVar="MyVar" execute="onExit-X.xml" MsgBox="ON EXIT MSGBOX"/>
<SetVar Exit2="var 2"/>
<MsgBox Message="SCRIPT IS ENDING"/>
</ytriaAutomation>
The sequence is: