Photoshop CS2
Adobe Photoshop CS2 Scripting Guide
Scripting Photoshop CS2 82
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:
●
ArtLayer
●
Rasterize()
method. Notice that the
RasterizeType.TEXTCONTENTS
argument uses the
RasterizeType
constant. Constants are always depicted in upper case letters in
Photoshop CS2 JavaScripts.
●
applyWave()
method
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
HelloWorldDoc
just above the commented statements that
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.
Содержание PHOTOSHOP CS 2.0 - SCRIPTING GUIDE
Страница 1: ...bbc Adobe Photoshop cs 2 Scripting Guide ...