Scripting Basics; Introducing Objects - Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual

Table of Contents

Advertisement

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
Model' on page
For information on selecting a scripting language, see
page
For examples of scripts created specifically for use with Photoshop CS2, see Chapter 3,
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
Note:
For more detailed information on commands and methods, see
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()
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
8.
4.
Document
.
command/method.
'Choosing a scripting language' on
.
object's
print/PrintOut/print()
'Photoshop CS2's Object
command/method.
'Using Commands and Methods'
'Scripting
6

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents