Adobe 23102480 Scripting Guide - Page 39

Using the Text Item Object

Page 39 highlights

Adobe Photoshop CS3 Scripting Guide Photoshop CS3 Scripting Photoshop CS3 39 VBS docRef.ArtLayers("L1").ApplyStyle "Puzzle (Image)" Look up ApplyStyle as a method of the ArtLayer object in the Adobe Photoshop CS3 Visual Basic Scripting Reference, or in the Visual Basic Object Browser. JS docRef.artLayers["L1"].applyStyle("Puzzle (Image)") Look up applyStyle() as a method of the ArtLayer object in the Adobe Photoshop CS3 JavaScript Scripting Reference, or in the ExtendScript Object Model Viewer. Using the Text Item Object You can change an existing ArtLayer object to a text layer, that is, a Text Item object, if the layer is empty. Conversely you can change a Text Item object to an ArtLayer object. This "reverse" procedure rasterizes the text in the layer object. The Text Item object is a property of the ArtLayer object. However, to create a new text layer, you must create a new ArtLayer object and then set the art layer's kind/Kind/kind property to text layer (2 (psTextLayer)/ LayerKind.TEXT. ). To set or manipulate text in a text layer, you use the text-object (TextItem/TextItem) object, which is contained in the text object/TextItem/textItem property of the ArtLayer object. Creating a Text Item Object The following examples create an ArtLayer object and then use the kind property to convert it to a text layer. AS make new art layer in current document with properties { kind: text layer } VBS set newLayerRef = docRef.ArtLayers.Add() newLayerRef.Kind = 2 '2 indicates psTextLayer JS var newLayerRef = docRef.artLayers.add() newLayerRef.kind = LayerKind.TEXT See 'Photoshop CS3 Object Model' on page 9 for information on the relationship between ArtLayer objects and TextItem objects. Also, look up the following: ● The Kind/kind and TextItem/textItem properties of the ArtLayer object in the Adobe Photoshop CS3 Visual Basic Scripting Reference, Adobe Photoshop CS3 JavaScript Scripting Reference, or in the Visual Basic Object Browser and the ExtendScript Object Model Viewer. ● The kind and text object properties of the class art layer 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
39
VBS
docRef.ArtLayers("L1").ApplyStyle "Puzzle (Image)"
Look up
ApplyStyle
as a method of the
ArtLayer
object in the
Adobe Photoshop CS3 Visual Basic
Scripting Reference
, or in the Visual Basic Object Browser.
JS
docRef.artLayers["L1"].applyStyle("Puzzle (Image)")
Look up
applyStyle()
as a method of the
ArtLayer
object in the
Adobe Photoshop CS3 JavaScript
Scripting Reference
, or in the ExtendScript Object Model Viewer.
Using the Text Item Object
You can change an existing
ArtLayer
object to a text layer, that is, a
Text Item
object, if the layer is
empty. Conversely you can change a
Text Item
object to an
ArtLayer
object. This “reverse” procedure
rasterizes the text in the layer object.
The
Text Item
object is a property of the
ArtLayer
object. However, to create a new text layer, you must
create a new
ArtLayer
object and then set the art layer's
kind/Kind/kind
property to
text layer (2
(psTextLayer)/ LayerKind.TEXT
. ).
To set or manipulate text in a text layer, you use the
text-object (TextItem/TextItem)
object, which is
contained in the
text object/TextItem/textItem
property of the
ArtLayer
object.
Creating a Text Item Object
The following examples create an
ArtLayer
object and then use the
kind
property to convert it to a text
layer.
AS
make new art layer in current document with properties { kind: text layer }
VBS
set newLayerRef = docRef.ArtLayers.Add()
newLayerRef.Kind = 2
'2 indicates psTextLayer
JS
var newLayerRef = docRef.artLayers.add()
newLayerRef.kind = LayerKind.TEXT
See
‘Photoshop CS3 Object Model’ on page 9
for information on the relationship between
ArtLayer
objects and
TextItem
objects.
Also, look up the following:
The
Kind/kind
and
TextItem/textItem
properties of the
ArtLayer
object in the
Adobe Photoshop
CS3 Visual Basic Scripting Reference
,
Adobe Photoshop CS3 JavaScript Scripting Reference
, or in the Visual
Basic Object Browser and the ExtendScript Object Model Viewer.
The
kind
and
text object
properties of the class
art layer
in the
Adobe Photoshop CS3 AppleScript
Scripting Reference
or in the Photoshop CS3 AppleScript Dictionary.