Adobe 23101335 Scripting Guide - Page 21
The Scripts menu, 2.9.1 Scripts folder, 2.9.2 The scripts dialog box
UPC - 718659152833
View all Adobe 23101335 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 21 highlights
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; } Scripting basics 2 The Scripts menu 2.9 The Scripts menu The Scripts menu item is located in the File > Automate menu. When the Scripts... item is selected, a dialog is presented from which you can select a JavaScript for execution. The scripts listed in the dialog are in the Scripts folder 2.9.1 Scripts folder The Scripts folder is in the Photoshop/Presets folder. This folder is created during Scripting Support functionality installation. All JavaScript files placed in the Scripts folder will be available for execution from the Scripts Dialog. Only those script files found in the root of the folder will be listed. Any files in subfolders will be ignored and not listed in the dialog. For both Mac and Windows, a JavaScript file must be saved as a text file with a '.js' file name extension. 2.9.2 The scripts dialog box To execute a script, select it from the list of scripts and click the "Run Script" button. If there is an error encountered during script execution, an error dialog will be displayed containing the error message returned by the script. If you hold down the option key (alt for Windows), the Photoshop 7.0 Scripting Guide 21