
Photoshop CS3
Adobe Photoshop CS3 Scripting Guide Scripting Photoshop CS3 38
Linking Layer Objects
Scripting also supports linking and unlinking layers. You link layers together so that you can move or
transform the layers in a single statement.
AS
make new art layer in current document with properties {name:"L1"}
make new art layer in current document with properties {name:"L2"}
link art layer "L1" of current document with art layer "L2" of ¬
current document
Look up the link command in the Adobe Photoshop CS3 AppleScript Scripting Reference or in the
Photoshop CS3 AppleScript Dictionary.
VBS
Set layer1Ref = docRef.ArtLayers.Add()
Set layer2Ref = docRef.ArtLayers.Add()
layer1Ref.Link layer2Ref
Look up Link in as a method of the ArtLayer object in the Adobe Photoshop CS3 Visual Basic Scripting
Reference, or in the Visual Basic Object Browser. Additionally, look up
Add as a method of the ArtLayers
object.
JS
var layerRef1 = docRef.artLayers.add()
var layerRef2 = docRef.artLayers.add()
layerRef1.link(layerRef2)
Look up link() as a method of the ArtLayer object in the Adobe Photoshop CS3 JavaScript Scripting
Reference, or in the ExtendScript Object Model Viewer. Additionally, look up
add() as a method of the
ArtLayers object.
Applying Styles to Layers
Note: This procedure corresponds directly to dragging a style from the Photoshop CS3 Styles palette to a
layer.
Your script can apply styles to an
ArtLayer object. To apply a style in a script, you use the apply layer
style/ApplyStyle/applyStyle()
command with the style’s name as an argument enclosed in straight
double quotes.
Note: The layer style names are case sensitive.
Please refer to Photoshop CS3 Help for a list of styles and for more information about styles and the Styles
palette.
The following examples set the Puzzle layer style to the layer named “L1.”
AS
apply layer style art layer "L1" of current document using "Puzzle (Image)"
Look up the apply layer style command in the Adobe Photoshop CS3 AppleScript Scripting Reference or
in the Photoshop CS3 AppleScript Dictionary.