Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual page 85

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
'use the Rasterize() method of the ArtLayer class to
'convert the text in the ArtLayer object (contained in the newTextLayer variable)
'to postscript text type
newTextLayer.Rasterize (1)
'create an array to define the selection property
'of the Document object
'define the selected area as an array of points in the document
docRef.Selection.Select Array(Array(0, 0), _
Array(docWidthInPixels / 2, 0), _
Array(docWidthInPixels / 2, docHeightInPixels), _
Array(0, docHeightInPixels), Array(0, 0))
'use the ApplyWave() method of the ArtLayer class
'to apply the wave of the selected text
newTextLayer.ApplyWave 1, 1, 100, 5, 10, 100, 100, 1, 1, 0
2. Choose Run > Run Sub/Userform or press F5 to run the script.
3. After viewing the document in Photoshop CS2, close the document without saving it.
4. Save the script.
Note:
Look up the following classes in the Adobe VBScript Scripting Reference to see if you understand how
you used them in this script:
JS
To select an area and apply a wave filter to it:
1. Type the following code into the script file
restore original preferences:
//create new variables to contain doc width and height
//convert inches to pixels by multiplying the number of inches by
//the resolution (which equals number of pixels per inch)
docWidthInPixels = docWidthInInches * resolution
docHeightInPixels = docHeightInInches * resolution
//use the rasterize method of the artLayer class
newTextLayer.rasterize(RasterizeType.TEXTCONTENTS)
//create a variable to contain the coordinate values
//for the selection object
selRegion = Array(Array(0, 0),
Array(docWidthInPixels / 2, 0),
Array(docWidthInPixels / 2, docHeightInPixels),
Array(0, docHeightInPixels),
Array(0, 0))
//use the select method of the selection object
//to create an object and give it the selRegion values
//as coordinates
class
ArtLayer
method
ApplyWave()
method
Rasterize()
class >
Selection
Select()
Photoshop CS2
method
just above the commented statements that
HelloWorldDoc
Scripting Photoshop CS2
81

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents