Adobe 23101335 - Photoshop - PC Manual page 65

Scripting guide
Hide thumbs Also See for 23101335 - Photoshop - PC:
Table of Contents

Advertisement

JS:
docRef.artLayers["my text"].textItem.justification =
IMPO R TAN T:
3.10.1 Setting the contents of the text item
To set the contents of a text item in AppleScript you would write:
set contents of text item of art layer "Layer 1" of ¬
If you use a text item object reference to set the contents you will need to write:
set contents of contents of textItemRef to "Hello"
The second "contents of" is needed because "contents" is a keyword which tells AppleScript
to operate on the contents of the variable, rather than on the object to which it may refer. This
means that AppleScript sees the above line as:
set text item of art layer 1 of document "Untitled-1" ¬
To set the contents using references in VB and JS, write the following:
VB:
textLayerRef.TextItem.Contents = "Hello"
JS:
textLayerRef.textItem.contents = "Hello";
Photoshop 7.0 Scripting Guide
Justification.RIGHT;
The text item object has a kind property, which can be set to either point
text (psPointText/TextType.POINTTEXT ) or paragraph text
(psParagraphText/TextType.PARAGRAPHTEXT ). When a new text
item is created, its kind property is automatically set to point text .
The text item properties height, width and leading are only valid
when the text item's kind property is set to paragraph text.
current document to "Hello"
to "Hello"
Scripting Photoshop
Text item object
3
65

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop 7.0

Table of Contents