Adobe 23101764 Scripting Guide - Page 30
Debugging and Error Handling
UPC - 718659340025
View all Adobe 23101764 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 30 highlights
Scripting basics 2 Debugging and Error Handling AS set flag to DoConfirm("Are you sure?") display dialog flag as string on DoConfirm(prompt) set button to button returned of (display dialog prompt ¬ buttons {"Yes", "No"} default button 1) return button = "Yes" end DoConfirm VB Private Sub ScriptSample_Click(Index As Integer) result = DoConfirm("Are you sure?") MsgBox (result) End Sub Function DoConfirm(prompt) As Boolean buttonPressed = MsgBox(prompt, vbYesNo) DoConfirm = (buttonPressed = vbYes) End Function JS var theResult = DoConfirm( "Are you sure?" ); alert(theResult); function DoConfirm(message) { var result = confirm(message); return result; } 2.10 Debugging and Error Handling Scripting environments provide tools for monitoring the progress of your script while it is running, which make it easier for you to track down any problems your script might be encountering or causing. Photoshop CS Scripting Guide 26