Linking Layer Objects; Applying Styles To Layers - Adobe 65048332 Manual

Scripting guide
Table of Contents

Advertisement

C
3: Scripting Photoshop
HAPTER

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
Photoshop AppleScript Dictionary.
VBS
Set layer1Ref = docRef.ArtLayers.Add()
Set layer2Ref = docRef.ArtLayers.Add()
layer1Ref.Link layer2Ref
Look up
Link
Reference, or in the Visual Basic Object Browser. Additionally, look up
object.
JS
var layerRef1 = docRef.artLayers.add()
var layerRef2 = docRef.artLayers.add()
layerRef1.link(layerRef2)
Look up
link()
Reference, or in the ExtendScript Object Model Viewer. Additionally, look up
ArtLayers

Applying styles to layers

N
: This procedure corresponds directly to dragging a style from the Photoshop Styles palette to a layer.
OTE
Your script can apply styles to an
style/ApplyStyle/applyStyle()
double quotes.
N
: The layer style names are case sensitive.
OTE
Please refer to Photoshop 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
the Photoshop AppleScript Dictionary.
VBS
docRef.ArtLayers("L1").ApplyStyle "Puzzle (Image)"
Look up
ApplyStyle
Reference, or in the Visual Basic Object Browser.
JS
docRef.artLayers["L1"].applyStyle("Puzzle (Image)")
Look up
applyStyle()
Scripting Reference, or in the ExtendScript Object Model Viewer.
command in the Adobe Photoshop CS5 AppleScript Scripting Reference or in the
link
in as a method of the
as a method of the
object.
ArtLayer
command in the Adobe Photoshop CS5 AppleScript Scripting Reference or in
apply layer style
as a method of the
as a method of the
object in the Adobe Photoshop CS5 Visual Basic Scripting
ArtLayer
object in the Adobe Photoshop CS5 JavaScript Scripting
ArtLayer
object. To apply a style in a script, you use the
command with the style's name as an argument enclosed in straight
object in the Adobe Photoshop CS5 Visual Basic Scripting
ArtLayer
object in the Adobe Photoshop CS5 JavaScript
ArtLayer
Working with the Photoshop Object Model 40
as a method of the
Add
as a method of the
add()
ArtLayers
apply layer

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

65048599Photoshop cs5

Table of Contents