36
3
Scripting Photoshop CS2
This chapter demonstrates several techniques for creating scripts to use specifically with Photoshop CS2.
More importantly, you will learn how to use the Photoshop CS2 scripting references to find the objects,
classes, properties, commands/methods, and even some values (called
constants
or
enumerations
) you can
use to create AppleScripts, VBScript scripts, and JavaScripts for Photoshop CS2.
Tip:
Throughout this chapter, the explanation of how to create a script is followed by instructions for
locating information about the specific elements used in the script. Using these instructions will help
you quickly understand how to script Photoshop CS2.
The explanations reference the following publications, which are available on the installation CD:
●
Adobe Photoshop CS2 AppleScript Scripting Reference
●
Adobe Photoshop CS2 Visual Basic Scripting Reference
●
Adobe Photoshop CS2 JavaScript Scripting Reference
Viewing Photoshop CS2 Objects, Commands and Methods
You can also view the reference data for AppleScript and VBScript within your script editor environment.
Note:
JavaScript is a cross-platform language and therefore does not require a specific script editor.
Viewing Photoshop CS2’s AppleScript Dictionary
You use Apple’s Script Editor application to view the dictionary.
Note:
The default location for the Script Editor is
Applications > AppleScript > Script Editor
.
➤
To view the AppleScript dictionary:
1. In Script Editor, choose
File > Open Dictionary
.
Script Editor displays an Open Dictionary dialog.
2. Choose Photoshop CS2, and then click
Open
.
Script Editor opens Photoshop CS2 and then displays the Photoshop CS2 dictionary, which lists objects
as well as the commands, properties and elements associated with each object. The dictionary also lists
the parameters for each command.
Note:
The Photoshop CS2 dictionary does not display the complete list of open and save formats. To view
the complete lists, look up the following commands in the
Adobe Photoshop CS2 AppleScript
Scripting Reference
:
●
open
●
save
Viewing Photoshop CS2’s Type Library (VBS)
You can use the VBA editor in Microsoft Word to display the objects and commands available for VBScript
in Photoshop CS2.