Photoshop CS Scripting Guide
54
Scripting Photoshop
Advanced Scripting
3
This code snippet manipulates and bends the text on the left side of the document.
Applying a MotionBlur Filter
Similar code can be used to blur the text in a document. Again create an array of points to
designate an area of the document. This time the width is defined as the distance from the
middle of the document to the far right side. The vertical positioning remains the same.
Select the right side of the document and apply a motion filter with parameters that define the
angle and radius of the blur. Then remove the selection so that the "marching ants" disappear
from the dialog.
To finish up, set application preferences back to their original values.
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
set ruler units of settings to theStartRulerUnits
set type units of settings to theStartTypeUnits
set display dialogs to theStartDisplayDialogs
end tell