Photoshop CS2
Adobe Photoshop CS2 Scripting Guide
Scripting basics 12
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 (
LayerSet
or
Layer
). When you use a numeric index to refer to an object, you use the
collection name, which is plural (
LayerSets
or
Layers
).
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
or
layerSet
or
layer
). When you use a numeric index to refer to an object, you use
the collection name, which is plural (
documents
or
layerSets
or
layers
).
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
open/Open/open()
command/method
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
open/Open/open()
command/method on a
Document
object but not on a
Selection
object which, obviously, cannot be opened.
●
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
open
in the “Commands” chapter of the scripting reference; or
you could look up the
Document
object in the “Objects” chapter.
●
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
Document
object in the “Interface” chapter, and then find
the object’s Methods table.
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
Содержание PHOTOSHOP CS 2.0 - SCRIPTING GUIDE
Страница 1: ...bbc Adobe Photoshop cs 2 Scripting Guide ...