6
2
Scripting basics
This chapter provides a brief introduction to the basic concepts and syntax of the scripting languages
AppleScript, VBScript, and JavaScript. If you are new to scripting, you should read this entire chapter.
If you are familiar with scripting or programming languages, you most likely will want to skip many
sections in this chapter. Use the following list to locate information that is most relevant to you.
●
For more information on Photoshop CS2’s object model, see
‘Photoshop CS2’s Object
Model’ on page 8
.
●
For information on selecting a scripting language, see
‘Choosing a scripting language’ on
page 4
.
●
For examples of scripts created specifically for use with Photoshop CS2, see Chapter 3,
‘Scripting
Photoshop CS2’ on page 36
.
●
For detailed information on Photoshop CS2 objects and commands/methods, please refer to the
following publications, which are located on the installation CD in the same directory as this Guide:
●
Adobe Photoshop CS2 AppleScript Scripting Reference
●
Adobe Photoshop CS2 Visual Basic Scripting Reference
●
Adobe Photoshop CS2 JavaScript Scripting Reference
Introducing Objects
A script is a series of commands that tell Photoshop CS2 what to do. Basically, the commands manipulate
objects.
What are objects in the context of a scripting language? When you use Photoshop CS2, you create
documents, layers, channels, and design elements, and you can work with a specific area of an image by
selecting the area. These things are objects. The Photoshop CS2 application is also an object.
Each type of object has its own properties and commands (AppleScript) or methods (VBScript and
JavaScript).
Properties describe or characterize the object. For example:
●
A layer object has a background color. It can also have a text item.
●
A channel object has color properties such as red, green, and blue.
●
The selected area of an image, or
selection object
, has size and shape properties.
Commands and methods describe actions you want to take on the object. For example, to print a
document, you use the
Document
object’s
print/PrintOut/print()
command/method.
Note:
For more detailed information on commands and methods, see
‘Using Commands and Methods’
on page 12
.
When you write a script to manipulate an object, you can use only the properties and commands or
methods defined for that object. For example, a Channel object does not, obviously, have a
print/PrintOut/print()
command/method.
How do you know which properties or commands/methods you can use? Adobe provides all the
information you need in the following references, which are available on the installation CD:
●
Adobe Photoshop CS2 AppleScript Scripting Reference
Содержание PHOTOSHOP CS 2.0 - SCRIPTING GUIDE
Страница 1: ...bbc Adobe Photoshop cs 2 Scripting Guide ...