Using Commands And Methods - Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
VBS
Object index reference:
appRef.ActiveDocument.LayerSets(0).Layers(0)
Object name reference:
appRef.ActiveDocument.LayerSet("Silhouettes").Layer("Profile")
You can also combine the two types of syntax:
appRef.ActiveDocument.LayerSets(1).Layer("Profile")
Tip:
Notice that when you refer to an object by its assigned name you use the object classname, which is
singular (
collection name, which is plural (
JS
Object index reference:
app.documents[1].layerSets[0].layers[0]
Object name reference:
appRef.document("MyDocument").layerSet("Silhouettes").layer("Profile")
You can also combine the two types of syntax:
appRef.activeDocument.layerSet("Silhouettes").layers[0]
Note:
When you refer to an object by its assigned name you use the object classname, which is singular
(
document
the collection name, which is plural (

Using Commands and Methods

Commands (in AppleScript) and methods (in VBScript and JavaScript) are directions you add to a script to
perform tasks or obtain results. For example, you could use the
to open a specified file.
Note:
You can use only the methods or commands associated with that object type. For example, you can
use the
object which, obviously, cannot be opened.
Commands and Command Properties
Commands (AppleScript) use normal English sentence syntax. The script statement begins with an
imperative verb form followed by a reference to the object upon which you want the script to perform the
task. The following AppleScript command prints the first layer of the current document:
print layer 1 of current document
or
LayerSet
Layer
or
or
layerSet
open/Open/open()
Before using a command on an AppleScript object, look up either the object type or the
command in the Adobe Photoshop CS2 AppleScript Scripting Reference to be sure the association
is valid.
For example, you could look up
you could look up the
Document
Before using a method on a VBScript or JavaScript object, look up the method in the Methods
table for the object type in the Adobe Photoshop CS2 Visual Basic Scripting Reference or the Adobe
Photoshop CS2 JavaScript Scripting Reference.
For example, you could look up the
the object's Methods table.
Photoshop CS2
). When you use a numeric index to refer to an object, you use the
or
LayerSets
Layers
). When you use a numeric index to refer to an object, you use
layer
or
documents
command/method on a
in the "Commands" chapter of the scripting reference; or
open
object in the "Objects" chapter.
object in the "Interface" chapter, and then find
Document
).
or
layerSets
layers
open/Open/open()
object but not on a
Document
Scripting basics
12
).
command/method
Selection

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PHOTOSHOP CS 2.0 - SCRIPTING GUIDE and is the answer not in the manual?

This manual is also suitable for:

Photoshop cs2

Table of Contents