Topic 6.2.1: Application Script

Configuring Application Scripts

 Application scripts are linked to the entire InTouch HMI application. You can use application scripts to:

  • Execute a script one time when WindowViewer is started. 
  • Execute a script periodically while WindowViewer is running.
  • Execute a script one time when WindowViewer is shut down.

 To configure an application script

1. Using the Classic View, in the Scripts pane, right-click on Application and then click Open. The Application Script dialog box appears.

 2. In the Condition Type list, click the condition for the script execution:

    • Click On Startup to configure a script to execute one time when WindowViewer is started.
    • Click While Running to configure a script to execute periodically while WindowViewer is running.
    • Click On Shutdown to configure a script to execute one time when WindowViewer is shut down.

3. If you selected While Running in the previous step, type a time interval between 1 and 360000 milliseconds in the Every box. The time interval specifies how often the script is executed.

4. Type your script in the window.

5. Click OK.

 To delete an application script

1. Using the Classic View, in the Scripts pane, right-click on  Application and then click Open. The Application Script dialog box appears.

2. In the Condition Type list, click the condition for the script to delete. The script appears in the main section of the Application Script dialog box.

3. On the Edit menu, click Clear. The script from the main section clears and the associated script is deleted.

 Limitations of Application Scripts

Application scripts that are executed when WindowViewer starts or shuts down have limitations on their interaction with other objects.

You cannot use On Startup application scripts to:

  • Reference ActiveX methods, properties, or events.
  • Read from or write to controls and I/O tagnames or remote references.
  • Run data change scripts and condition scripts.

You cannot use On Shutdown application scripts to:

  • Read from or write to controls and I/O tagnames or remote references.
  • Start other applications.
Last modified: Saturday, 7 March 2020, 2:53 PM