Adobe photoshop cs 2.0 User Guide

Page of 91
Photoshop CS2
Adobe Photoshop CS2  Scripting Guide
 Scripting Photoshop CS2     53
current document
Look up the 
link
 command in the Adobe Photoshop CS2 AppleScript Scripting Reference
VBS
Set layer1Ref = docRef.ArtLayers.Add()
Set layer2Ref = docRef.ArtLayers.Add()
layer1Ref.Link layer2Ref.Layer
Look up 
Link
 in the Methods table of the 
ArtLayer
 object in the Adobe Photoshop CS2 Visual Basic 
Scripting Reference. Additionally, look up 
Add
 in the Methods table of the 
ArtLayers
 object. 
JS
var layerRef1 = docRef.artLayers.add()
var layerRef2 = docRef.artLayers.add()
layerRef1.link(layerRef2)
Look up 
link()
 in the Methods table of the 
ArtLayer
 object in the Adobe Photoshop CS2 JavaScript 
Scripting Reference. Additionally, look up 
add()
 in the Methods table of the 
ArtLayers
 object.
Applying Styles to Layers
Note:
This procedure corresponds directly to dragging a style from the Photoshop CS2 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/method 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 CS2 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 “Commands” chapter of the Adobe Photoshop CS2 
AppleScript Scripting Reference.
VBS
docRef.ArtLayers("L1").ApplyStyle "Puzzle (Image)"
Look up 
ApplyStyle
 in the Methods table of the 
ArtLayer 
object in the Adobe Photoshop CS2 Visual Basic 
Scripting Reference.
JS
docRef.artLayers["L1"].applyStyle("Puzzle (Image)")
Look up 
applyStyle()
 in the Methods table of the 
ArtLayer 
object in the Adobe Photoshop CS2 
JavaScript Scripting Reference.