Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual page 42

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
New icon on the appropriate palette. This section demonstrates how to accomplish these same tasks in a
script.
To create an object in a script, you name the type of object you want to create and then use the following
command/method:
AS:
make
VBS:
Add
JS:
add()
As you can see in the Photoshop CS2 Object Model, the Document object contains all other objects except
the Application object. Therefore, you must reference the
than
Document
Note:
In VBScript and JavaScript, you use the object's collection name to name the object type. For
example, you add a document to the
collection. See
AS
The following statement creates a
make new document
You can also use the
following example, the variable named
set docRef to make new document
To create an object other than a document, you must reference the
object. The following sample creates an art layer in the document contained in the variable named
.
docRef
make new art layer in docRef
Note:
When you create object in AppleScript, you actually add the object to an element the same way you
add a VBScript or JavaScript object to a collection. However, in AppleScript, the element name is
implied in the
actually means:
Do the following to find out more about creating objects in an AppleScript:
Look up the
AppleScript Scripting Reference.
To find out which commands can be used with an object, look up the object or the object's element
name in the "Objects" chapter in the Adobe Photoshop CS2 AppleScript Scripting Reference and check the
Valid Commands list. For example, look up "document" or "documents" to learn which commands can
be used with
VBS
In VBScript, you can use the
objects other than collection objects. Also, in VBScript, you must reference the
creating when creating, or referring to, an object in your script.
For example, to create a document in a VBScript script, you cannot use the object name, as in the following
sample, which creates a
appRef.Document.Add()
objects to your script.
'Object Elements and Collections' on page 9
command to create a variable to hold a reference to a new document. In the
set
or
make
set
make new document
make new document in the documents element
and
commands in the "Commands" chapter in the Adobe Photoshop CS2
make
set
objects.
Document
method only with the collection name. The
Add
Document
Photoshop CS2
collection; you add an art layer to the
Documents
object in an AppleScript.
Document
holds a reference to the new document:
docRef
statement. For example, the statement:
object:
Scripting Photoshop CS2
object when adding objects other
Document
for more information.
object that contains the
Document
method is not valid with
Add
Application
38
art layers
object when

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents