Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual page 81

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
set stroke color of text object of theTextLayer to theTextColor
2. Run the complete script. Be patient while Photoshop CS2 executes your commands one by one.
3. After viewing the document in Photoshop CS2, close the document without saving it.
Note:
Look up the following classes in the Adobe AppleScript Scripting Reference to see if you understand
how you used them in this script:
VBS
To create and specify details in a text item:
1. Type the following code into the
statements that restore original preferences.
'create a reference to the active (current) document
Set docRef = app.ActiveDocument
' create a variable named textColor
'create a SolidColor object whose color is red
'assign the object to textColor
Set textColor = CreateObject ("Photoshop.SolidColor")
textColor.RGB.Red = 255
textColor.RGB.Green = 0
textColor.RGB.Blue = 0
'create an art layer object using the
'Add method of the ArtLayers class
'assign the layer to the variable newTextLayer
Set newTextLayer = docRef.ArtLayers.Add()
'use the Kind property of the Art Layers class to
'make the layer a text layer
newTextLayer.Kind = 2
newTextLayer.TextItem.Contents = helloWorldStr
newTextLayer.TextItem.Position = Array(0.75, 1)
newTextLayer.TextItem.Size = 36
newTextLayer.TextItem.Color = textColor
2. Run the complete script. Be patient while Photoshop CS2 executes your commands one by one.
3. After viewing the document in Photoshop CS2, close the document without saving it.
Note:
Look up the following classes in the Adobe VBScript Scripting Reference "Object Reference" chapter to
see if you understand how you used them in this script:
RGB color class
Art Layer class
SolidColor
ArtLayer
Photoshop CS2
script immediately before the commented
HelloWorldDoc
Scripting Photoshop CS2
77

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents