Adobe 23102480 Scripting Guide - Page 38

Linking Layer Objects, AS, VBS, JS, Applying Styles to Layers

Page 38 highlights

Adobe Photoshop CS3 Scripting Guide Photoshop CS3 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.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85

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.