Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual page 59

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
JS
if (newLayerRef.kind == LayerKind.TEXT)
Adding and Manipulating Text in a Text Item Object
The following examples add and right-justify text in a text layer.
AS
set contents of text object of art layer "my text" to "Hello, World!"
set justification of text object of art layer "my text" of ¬
current document to right
VBS
Set textItemRef = artLayers("my text").TextItem
textItemRef.Contents = "Hello, World!"
docRef.ArtLayers("my text").TextItemRef.Justification = 3
'3 = psRight (for the constant value psJustification)
JS
var textItemRef = artLayers["my text"].textItem
textItemRef.contents = "Hello, World!"
docRef.artLayers["my text"].textItemRef.justification =
Justification.RIGHT
Note:
The
/psPointText/TextType.POINTTEXT
text/psParagraphText/TextType.PARAGRAPHTEXT
property is automatically set to
The
property is set to
To familiarize yourself with this objects, properties, and commands/methods in the scripting references,
do the following:
In the Adobe Photoshop CS2 AppleScript Scripting Reference, look up the
properties and methods.
In the Adobe Photoshop CS2 Visual Basic Scripting Reference and the Adobe Photoshop CS2 JavaScript
Scripting Reference, look up the
and methods you can use with a text layer, look up the
Working with Selection Objects
You create a
document or a layer within a document. For example, you can apply effects to a selection or copy the
current selection to the clipboard.
The
Selection
In the Adobe Photoshop CS2 AppleScript Scripting Reference, look up
Also, look up the
selection-object
object has a
text item
properties
text item
height, width
paragraph text.
object to allow your scripts to act only on a specific, selected section of your
Selection
object is a property of the
property of the
selection
.
Photoshop CS2
property, which can be set to either
kind
/ or
paragraph
.
point text
and
leading
property of the
TextItem
object. Look up the following for more information:
Document
Class Document
Scripting Photoshop CS2
point text
. When a new
text item
are valid only when the text item's
Class text-object
object. To find the properties
ArtLayer
object.
TextItem
in the "Commands" chapter.
select
object and the
Class
55
is created, its
kind
kind

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents