DO SCRIPT command

Used to execute a secondary script from within your script.


DO <SCRIPT> script_name {<IF test>|<WHILE test>}


SCRIPT script_name

Specifies the name of a script in the ACL project to run. You can omit the SCRIPT keyword from this parameter.

IF test

Optional. Specifies a condition that is evaluated one time to determine if the script should be executed. If the condition evaluates to true the script runs, otherwise it does not.

WHILE test

Optional. Specifies a condition that is evaluated after the script runs to determine if the script should be executed again. If the test evaluates to true the script runs again, otherwise it does not.


Scripts can be run conditionally, based on the current values of fields and variables. You cannot specify both and IF test and a WHILE test in the same DO SCRIPT command. If both tests are specified, the WHILE test is ignored when the script is processed. A comment is entered in the log, but the script does not stop executing.

If you use the WHILE parameter, you must ensure that your test eventually evaluates to false, otherwise an infinite loop will be created. If you do create an infinite loop, you can press the Esc key to cancel script processing.

The DO SCRIPT command cannot call a script that is already running. For example, if ScriptA calls ScriptB, ScriptB cannot call ScriptA. ScriptA is still running while it waits for ScriptB to complete.

The DO SCRIPT command is equivalent to the DO BATCH command, which may be found in scripts created with earlier releases of ACL.

You cannot include the DO SCRIPT command inside a GROUP command.


The following example executes a subscript repeatedly until the input is validated. This could be used to gather user input using a dialog box. The subscript would be responsible for prompting the user for the required values, checking the user input, and setting the v_validated variable to true when the input values were validated. Once the value of the variable changes the main script moves on to the next command.

DO SCRIPT GetUserInput WHILE v_validated = F

(C) 2015 ACL Services Ltd. All Rights Reserved.