Adobe 23101764 - Photoshop CS - PC Manual page 52

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

Advertisement

Notice that the position property of the text layer is an array whose values were chosen to
roughly center the text in the dialog. A relatively large font size was chosen to increase the
visibility of the text message. The color property is the SolidColor object created earlier,
whose function is to display text in red.
This code snippet outputs "Hello, World!" in red.
Applying a Wave Filter
Now that text displays on your document, you're ready to apply some special effects. First, re-
define the width and height of the document in pixels. Additionally, convert the text layer to
pixels -- we do this because text is a vector graphic and we need a bitmap in order to
manipulate the image.
Next create an array to specify the area to be selected for image manipulation. Notice that the
array of points begins at the top left corner of the dialog and extends half way across the
document. Other array values define vertical positioning.
With the width and height of the array thus defined, select the left side of the document. "Ants
marching up the page" delimit the area selected.
Photoshop CS Scripting Guide
Set docRef = app.ActiveDocument
Set textColor = New Photoshop.SolidColor
textColor.RGB.Red = 255
textColor.RGB.Green = 0
textColor.RGB.Blue = 0
Set newTextLayer = docRef.ArtLayers.Add()
newTextLayer.Kind = Photoshop.PsLayerKind.psTextLayer
newTextLayer.TextItem.Contents = helloWorldStr
newTextLayer.TextItem.Position = Array(0.75, 1)
newTextLayer.TextItem.Size = 36
newTextLayer.TextItem.Color = textColor
Scripting Photoshop
Advanced Scripting
3
48

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs

Table of Contents