Adobe 26001360 Scripting Guide - Page 26
AppleScript, Visual Basic
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 26 highlights
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