Adobe 23101764 Scripting Guide - Page 56
Notice that the position property of the text layer is an array whose values were chosen
UPC - 718659340025
View all Adobe 23101764 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 56 highlights
Scripting Photoshop 3 Advanced Scripting Displaying Colored Text Having generated a default document, you can now display colored text. To do so, first set a local reference to the current document. Then create a SolidColor object and assign RGB color values to it. After defining the text for the current layer, create an art layer of type text layer. NOTE: For a complete listing of all AppleScript properties, methods and constants (such as text layer), please refer to the AppleScript Reference Guide, included as a separate document with Photoshop CS. Next, set the text, position, size and color of the text layer. The contents of the text layer is the expression "Hello, World!". 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 theTextColor created earlier, whose function is to display text in red. set theDocRef to the current document set theTextColor to {class:RGB color, red:255, green:0, blue:0} set theTextLayer to make new art layer in theDocRef with¬ properties {kind:text layer} set contents of text object of theTextLayer to "Hello, World!" set size of text object of theTextLayer to 36 set position of text object of theTextLayer to {0.75, 1} set stroke color of text object of theTextLayer to theTextColor This code snippet outputs "Hello, World!" in red. Photoshop CS Scripting Guide 52