Adobe 23101764 Scripting Guide - Page 29
Handlers, subroutines and functions
UPC - 718659340025
View all Adobe 23101764 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 29 highlights
Scripting basics 2 Handlers, subroutines and functions VB flag = False Do While flag = False retVal = MsgBox("Quit?", vbOKCancel) If (retVal = vbCancel) Then flag = True End If Loop flag = False Do Until flag = True retVal = MsgBox("Quit?", vbOKCancel) If (retVal = vbOK) Then flag = True End If Loop JS var flag = false; while (flag == false) { flag = confirm("Are you sure?"); } var flag = false; do { flag = confirm("Are you sure?"); } while (flag == false); 2.9 Handlers, subroutines and functions Subroutines, or handlers (in AppleScript) and functions (in JavaScript), are scripting modules you can refer to from within your script. These subroutines provide a way to re-use parts of scripts. Typically, you send one or more values to a subroutine and it returns one or more values. There's nothing special about the code used in subroutines - they are conveniences that save you from having to retype the same code lines in your script. Photoshop CS Scripting Guide 25