Adobe 26001360 - Illustrator CS - PC Manual page 26

Scripting guide
Hide thumbs Also See for 26001360 - Illustrator CS - PC:
Table of Contents

Advertisement

26
Scripting concepts
for repetitive processes, or "loops." The idea of a loop is to repeat some action over and over
again, with or without changes each time through the loop, until some condition is met.
Both AppleScript and Visual Basic have a variety of different control structures to choose from.
The simplest form of a loop is one that repeats some series of script operations a set number of
times.
AppleScript
repeat with counter from 1 to 20
display dialog counter
end repeat
Visual Basic
For counter = 1 to 20
MsgBox counter
Next
A more complicated type of control structure includes conditional logic, so that it loops while
or until some condition is true or false.
AppleScript
repeat while flag = false
set flag to (button returned of display dialog "Quit?") = "Cancel"
end repeat
repeat until flag = true
set flag to (button returned of display dialog "Quit?") = "OK"
end repeat
Visual Basic
Do While flag = false
flag = (MsgBox ("Quit?", vbOKCancel)) = vbCancel
loop
Do Until flag = true
flag = (MsgBox ("Quit?", vbOKCancel)) = vbOK
loop
12 Aug 03

Advertisement

Table of Contents
loading

This manual is also suitable for:

Illustrator cs

Table of Contents