48
4
Flow Control
Statements in a script are executed in the order they are written in the script. Flow control statements
let you change this flow and execute statements selectively and repetitively. You can insert an empty
flow control statement into a script by clicking the
Insert Logic
button on the Script Editor toolbar.
Flow control statements can be either Conditional or Repetitive. Conditional statements use the
If/Then/Else
or
Switch/Case
to execute statements if certain conditions are met. Repetitive
statements let you execute the same blocks of statements multiple times.
Conditional Statements
If/Then
The simplest form of flow control is to execute an Action when a condition is TRUE, for example:
•
a document contains more than one page
•
a document is in PDF format
•
it is later than 5 PM.
The basic format is
if (expression)
then
statement 1
statement 2
...
endif
The expression must result in a boolean value of TRUE or FALSE. Each statement between
then
and
endif
will be executed once in the order they are written in the script. You can use the following
operators to compare strings, integers, and real numbers with one another.
Symbol
Operation
<, LT
Less than
>, GT
Greater than
<=, LE
Less than or Equal To
>=, GE
Greater Than or Equal To
==, EQ
Equal To
!=, <>, NE
Not Equal To