Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual page 84

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
set theDocWidthInPixels to theDocWidthInInches *¬
theDocResolution
set theDocHeightInPixels to theDocHeightInInches *¬
theDocResolution
--use the rasterize command of the art layer object
rasterize theTextLayer affecting text contents
--create a variable named theSelRegion
--assign an array of coordinates as its value
set theSelRegion to {{0, 0}, ¬
{theDocWidthInPixels / 2, 0}, ¬
{theDocWidthInPixels / 2, theDocHeightInPixels}, ¬
{0, theDocHeightInPixels}, ¬
{0, 0}}
--replace the document object with the selection object
--so that the wave is applied only to the selected text
select theDocRef region theSelRegion combination type replaced
--apply the wave filter using the filter command of the
--wave filter class (inherited from the filter options super class)
filter current layer of theDocRef using wave filter ¬
with options {class:wave filter, number of generators:1 ¬
, minimum wavelength:1, maximum wavelength:100, ¬
minimum amplitude:5, maximum amplitude:10 ¬
, horizontal scale:100, vertical scale:100 ¬
, wave type:sine, undefined areas:repeat edge pixels,¬
random seed:0}
2. Choose Run to run the script.
3. After viewing the document in Photoshop CS2, close the document without saving it.
4. Save the script in the Script Editor.
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 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
wave filter class
art layer class
command
rasterize
command
filter
>
document class
select
Photoshop CS2
command,
combination type
HelloWorldDoc
Scripting Photoshop CS2
parameter
just above the commented statements that
80

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents