Adobe 23101335 Scripting Guide - Page 63

Applying styles to layers, 3.9.5 Rotating layers, docRef.ArtLayersL1.ApplyStyle Puzzle Image

Page 63 highlights

Scripting Photoshop 3 Layer objects 3.9.4 Applying styles to layers Styles can be applied to layers from your scripts. The styles correspond directly to the styles in the Photoshop Styles palette and are referenced by their literal string name. Here is an example of how to set a layer style to the layer named "L1." NOTE: The layer styles name is case sensitive. AS: apply layer style art layer "L1" of current document using ¬ "Puzzle (Image)" VB: docRef.ArtLayers("L1").ApplyStyle "Puzzle (Image)" JS: docRef.artLayers["L1"].applyStyle("Puzzle (Image)"); 3.9.5 Rotating layers Use the rotate (Rotate/rotate) command on the layer to rotate the entire layer. Positive integers rotate the layer clockwise. Negative integers rotate it counterclockwise. AS: rotate current layer of current document angle 45.0 VB: docRef.ActiveLayer.Rotate 45.0 JS: docRef.activeLayer.rotate(45.0); Photoshop 7.0 Scripting Guide 63

  • 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
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91

Photoshop 7.0 Scripting Guide
63
Scripting Photoshop
Layer objects
3
3.9.4 Applying styles to layers
Styles can be applied to layers from your scripts. The styles correspond directly to the styles in
the Photoshop Styles palette and are referenced by their literal string name. Here is an example
of how to set a layer style to the layer named “L1.”
N
OTE
:
The layer styles name is case sensitive.
AS:
apply layer style art layer "L1" of current document using ¬
"Puzzle (Image)"
VB:
docRef.ArtLayers("L1").ApplyStyle "Puzzle (Image)"
JS:
docRef.artLayers["L1"].applyStyle("Puzzle (Image)");
3.9.5 Rotating layers
Use the
rotate (Rotate/rotate)
command on the layer to rotate the entire layer. Positive
integers rotate the layer clockwise. Negative integers rotate it counterclockwise.
AS:
rotate current layer of current document angle 45.0
VB:
docRef.ActiveLayer.Rotate 45.0
JS:
docRef.activeLayer.rotate(45.0);