Inverting Selections; Filling A Selection - Adobe 23102480 - Photoshop CS3 - PC Programming Manual

Scripting guide
Table of Contents

Advertisement

Adobe Photoshop CS3 Scripting Guide
JS
strokeColor = new solidColor
strokeColor.cmyk.cyan = 20
strokeColor.cmyk.magenta = 50
strokeColor.cmyk.yellow = 30
strokeColor.cmyk.black = 0
app.activeDocument.selection.stroke (strokeColor, 2,
StrokeLocation.OUTSIDE, ColorBlendMode.VIVIDLIGHT, 75,

Inverting Selections

You can use the
can work on the rest of the document, layer or channel while protecting the selection.
AS
invert selection of current document
VBS
selRef.Invert
JS
selRef.invert()
Expanding, Contracting, and Feathering Selections
You can change the size of a selected area using the expand, contract, and feather commands.
The values are passed in the ruler units stored in Photoshop CS3 preferences and can be changed by your
scripts. If your ruler units are set to pixels, then the following examples will expand, contract, and feather
by five pixels. See section
ruler units.
AS
expand selection of current document by pixels 5
contract selection of current document by pixels 5
feather selection of current document by pixels 5
VBS
Dim selRef
Set selRef = appRef.ActiveDocument.Selection
selRef.Expand 5
selRef.Contract 5
selRef.Feather 5
JS
var selRef = app.activeDocument.selection
selRef.expand( 5 )
selRef.contract( 5 )
selRef.feather( 5 )

Filling a Selection

You can fill a selection either with a color or a history state.
To fill with a color:
false)
invert (Invert/invert())
'Setting Application Preferences' on page 30
Photoshop CS3
command of the
Scripting Photoshop CS3
object to a selection so you
Selection
for examples of how to change
43

Advertisement

Table of Contents
loading

This manual is also suitable for:

13102498 - photoshop cs3 - macPhotoshop cs3

Table of Contents