Adobe photoshop cs 2.0 Guia Do Utilizador

Página de 91
Photoshop CS2
Adobe Photoshop CS2  Scripting Guide
 Scripting basics     28
3. When the user clicks OK (for “Please quit!”), the script displays a different dialog that asks if the user is 
sure they want to quit.
4. When the user clicks Cancel in the new dialog, they see the second dialog again. 
5. When the user clicks OK, the loop ends and the dialogs quit appearing. 
AS
--create a variable named flag and make its value false
set flag to false
--create the loop and the condition
repeat until flag = true
--the following assumes that a yes response evaluates to true
set flag to button returned of (display dialog "Quit?" ¬
 buttons {"OK", "Cancel"}) = "OK"
end repeat
--change the value of flag back to false for the new loop
set flag to false
--create the new loop 
repeat while flag = false
set flag to button returned of (display dialog "Are you sure?" ¬
 buttons {"OK", "Cancel"}) = "Cancel"
end repeat
VBS
'create a variable named flag of type Boolean and
'set its value to False
Dim flag As Boolean
flag = False
'create the loop and the condition
Do While flag = False
    retVal = Alert("Quit?", vbOKCancel)
If (retVal = vbCancel) Then
  flag = True
End If
Loop
flag = False
Do Until flag = True
    retVal = Alert("Quit?", vbOKCancel)
    If (retVal = vbOK) Then
        flag = True
    End If
Loop
JS
//create a variable named flag and make its value false
var flag = false
//create the loop and the condition
while (flag == false)