Configure application scripts
- Last UpdatedSep 11, 2025
- 3 minute read
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.
Configure an application script
-
In the Scripts pane, right-click on Application and then select Open.
The Application Script dialog box appears.
-
In the Condition Type list, select the condition for the script execution:
-
Select On Startup to configure a script to execute one time when WindowViewer is started.
Example: In an InTouch application if the initial value of a tag named Flow is 50 and if you want to change this value on application startup, then select the Condition Type as On Startup and use the following script:
Flow = 25;

-
Select While Running to configure a script to execute periodically while WindowViewer is running.
Example: Consider an InTouch application with tag named Flow. While running the application, if you want the value of Flow to increase by 5 for every 2 seconds and if you want to display a window named Warning when the value of the tag is more than or equal to 100, then set the Condition Type to While Running and use the following script:
Flow = Flow + 5;
If Flow >= 100 THEN Show "Warning"
ENDIF;

-
Select On Shutdown to configure a script to execute one time when WindowViewer is shut down.
Example: Consider an InTouch application with tag named Flow. On closing the application if you want the value of Flow to be changed to 0, then set the Condition Type to On Shutdown and use the following script:
Flow = 0;

-
-
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.
-
Type your script in the window.
-
Select OK.
Delete an application script
-
In the Scripts pane, right-click on Application and then select Open.
The Application Script dialog box appears.
-
In the Condition Type list, select the condition for the script to delete.
The script appears in the main section of the Application Script dialog box.
-
On the Edit menu, select Clear.
The script from the main section clears and the associated script is deleted.