Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual page 86

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
docRef.selection.select(selRegion)
//
newTextLayer.applyWave(1, 1, 100, 5, 10, 100, 100,
WaveType.SINE, UndefinedAreas.WRAPAROUND, 0)
2. Save the script, and then open Photoshop CS2 and select the script from the Scripts menu (choose File
> Script > HelloWorldDoc).
3. After viewing the document in Photoshop CS2, close Photoshop CS2 without saving the document.
Note:
Look up the following classes in the Adobe JavaScript Scripting Reference "Object Reference" chapter
to see if you understand how you used them in this script:
Applying a MotionBlur Filter
In this section, we will apply a different filter to the other half of our document.
Additionally, because this is the last exercise in this that deals with our Hello World document, we will
uncomment the statements that reset our original application preferences for rulers and units.
AS
To apply a motionblur filter to HelloWorldDoc:
1. Type the following code into the script file
restore original preferences.
--change the value of the variable theSelRegion
--to contain the opposite half of the screen
set theSelRegion to {{theDocWidthInPixels / 2, 0},¬
{theDocWidthInPixels, 0}, ¬
{theDocWidthInPixels, theDocHeightInPixels}, ¬
{theDocWidthInPixels / 2, theDocHeightInPixels}, ¬
{theDocWidthInPixels / 2, 0}}
select theDocRef region theSelRegion combination type replaced
filter current layer of theDocRef using motion blur ¬
with options {class:motion blur, angle:45, radius:5}
deselect theDocRef
2. Delete the hyphens from the commented statements immediately above the end tell statement as
follows:
app.Preferences.RulerUnits = startRulerUnits
app.Preferences.TypeUnits = startTypeUnits
3. Choose Run to run the script.
ArtLayer
method. Notice that the
Rasterize()
constant. Constants are always depicted in upper case letters in
RasterizeType
Photoshop CS2 JavaScripts.
method
applyWave()
Photoshop CS2
RasterizeType.TEXTCONTENTS
just above the commented statements that
HelloWorldDoc
Scripting Photoshop CS2
argument uses the
82

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PHOTOSHOP CS 2.0 - SCRIPTING GUIDE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Photoshop cs2

Table of Contents