Adobe 23102480 Scripting Guide - Page 8
Scripting Support in Photoshop CS3, JavaScript Support - photoshop cs3 for windows
UPC - 883919080222
View all Adobe 23102480 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 8 highlights
Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Photoshop CS3 Scripting Basics 8 ● A single script can perform actions that involve multiple applications. For example, depending on the scripting language you are using, you could target both Photoshop CS3 and another Adobe Creative Suite 3 Application, such as Illustrator® CS3, in the same script. ● You can open, save, and rename files using scripts. ● You can copy scripts from one computer to another. If you were using an Action and then switched computers, you'd have to recreate the Action. ● Scripts provide more versatility for automatically opening files. When opening a file in an action, you must hard code the file location. In a script, you can use variables for file paths. Note: See Photoshop CS3 Help for more information on Photoshop CS3 Actions. Scripting Support in Photoshop CS3 Photoshop CS3 supports scripting in three scripting languages: AppleScript, VBScript, and JavaScript. AppleScript and JavaScript run on Mac OS, and JavaScript and VBScript run on Windows. For information about how to choose which scripting language to use, and for additional information about using these languages with Adobe applications, see Introduction to Scripting. See 'Creating and Running an AppleScript' on page 15, 'Creating and Running a VBScript' on page 16, and 'Creating and Running a JavaScript' on page 17. You can call JavaScript scripts from AppleScript and VBScript scripts. See 'Executing JavaScripts from AS or VBS' on page 9. For a file to be recognized by Photoshop as a valid script file it must have the correct file name extension: Script Type AppleScript JavaScript ExtendScript VBScript Visual Basic File Type compiled script OSAS file text text executable Extension .scpt (none) .js .jsx .vbs .exe Platform Mac OS® Mac OS & Windows Windows Windows JavaScript Support For a JavaScript file to be recognized by Photoshop as a valid script file, it must use either a .js or a .jsx extension. On the Mac OS, there is no difference in the way scripts with the two extensions function. On Windows, if the script files is opened from inside Photoshop, there is no difference between using the .js and .jsx extension. However, if the script is launched by double-clicking on it, a script with the .js extension is interpreted with the Microsoft JScript engine, and it cannot launch Photoshop CS3. For Windows, using the .jsx extension is preferable, since it interprets the script with the ExtendScript engine. Scripts written in JavaScript can be accessed from the Adobe Photoshop CS3 Scripts menu (File > Scripts), which provides quick and easy access to your JavaScripts. By putting a JavaScript file into the appropriate location on disk, it can be accessed directly from the Photoshop CS3 menu.