Scripting, About scripting, Run a javascript – Adobe Photoshop CS4 User Manual
Page 639: Support external automation through scripting (see

632
USING PHOTOSHOP CS4
Automating tasks
Last updated 1/10/2010
File Naming
Specifies file naming conventions if writing files to a new folder. Select elements from the pop-up menus or
enter text into the fields to be combined into the default names for all files. The fields let you change the order and
formatting of the components of the filename. You must include at least one field that is unique for every file (for example,
filename, serial number, or serial letter) to prevent files from overwriting each other. Starting Serial Number specifies the
starting number for any serial number fields. Serial letter fields always start with the letter “A” for the first file.
Compatibility
Makes filenames compatible with Windows, Mac
OS, and UNIX operating systems.
Saving files using the Batch command options usually saves the files in the same format as the original files. To create
a batch process that saves files in a new format, record the Save As command followed by the Close command as part
of your original action. Then choose Override Action “Save As” Commands for the Destination when setting up the batch
process.
Error menu
Specifies how to handle processing errors:
•
Stop For Errors
Suspends the process until you confirm the error message.
•
Log Errors to File
Records each error in a file without stopping the process. If errors are logged to a file, a message
appears after processing. To
review the error file, open with a text editor after the Batch command has run.
More Help topics
Scripting
About scripting
Photoshop supports external automation through scripting. In Windows, you can use scripting languages that support
COM automation, such as VB Script. In Mac
OS, you can use languages such as AppleScript that allow you to send
Apple events. These languages are not cross-platform but can control multiple applications such as Adobe Photoshop,
Adobe Illustrator, and Microsoft Office. In Mac
OS, you can also use Apple’s Photoshop Actions for Automator to
control tasks in Photoshop.
You can also use JavaScript on either platform. JavaScript support lets you write Photoshop scripts that run on either
Windows or Mac
OS.
Note: Refer to the scripting documentation included with your Photoshop application installation: Photoshop CS4
AppleScript Ref.pdf, Photoshop CS4 JavaScript Ref.pdf, Photoshop CS4 Scripting Guide.pdf, and Photoshop CS4 VBScript
Ref.pdf. These guides can be found in Photoshop CS4/Scripting Guide. The Scripting Guide can be found at Application
Folder > Scripting > Documents. The Scriptlistener Plug-In can be found at Application Folder > Scripting > Utilities.
Run a JavaScript
❖
Choose File
> Scripts and then select the script from the list. The scripts list includes all the script files saved with a
.js or .jsx extension and saved in the Photoshop CS4/Presets/Scripts folder. To run a script saved in another
location, choose File
> Scripts
> Browse and navigate to the script.