Chapter Description

This chapter demonstrates several techniques for creating scripts to use specifically with Adobe Photoshop CS2. More importantly, you'll learn how to use the Adobe Photoshop CS2 scripting references to find the objects, classes, properties, methods, and even some values (called constants or enumerations) you can use to create JavaScripts for Adobe Photoshop CS2.

From the Book

This chapter demonstrates several techniques for creating scripts to use specifically with Adobe Photoshop CS2.

More importantly, you will learn how to use the Adobe Photoshop CS2 scripting references to find the objects, classes, properties,
methods, and even some values (called constants or enumerations) you can use to create JavaScripts for Adobe 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 Adobe Photoshop
CS2.

Viewing Photoshop CS2 objects, commands, and methods

In JavaScript, all properties and methods of the application are accessible without any qualification. You can reference the
application as part of the containment hierarchy or leave it out, whichever makes your scripts easier for you to read. The
following statements are equivalent:

var docRef = app.documents[1]

and

var docRef=documents[1]

Note

JavaScript samples throughout this guide do not reference the Application object.