Stroking The Selection Border; Inverting Selections; Expanding, Contracting, And Feathering Selections - Adobe 65014912 Manual

Photoshop cs4 extended
Table of Contents

Advertisement

C
3: Scripting Photoshop
HAPTER
JS
var docRef = app.documents.add(500, 500)
var shapeRef = [
[0,0],
[0,100],
[100,100],
[100,0]
]
docRef.selection.select(shapeRef)

Stroking the selection border

The following examples use the
the boundaries around the current selection and set the stroke color and width.
N
: The transparency parameter cannot be used for background layers.
OTE
AS
stroke selection of current document using color ¬
{class:CMYK color, cyan:20, magenta:50, yellow:30, black:0} ¬
width 5 location inside blend mode vivid light opacity 75 ¬
without preserving transparency
VBS
Set strokeColor = CreateObject ("Photoshop.SolidColor")
strokeColor.CMYK.Cyan = 20
strokeColor.CMYK.Magenta = 50
strokeColor.CMYK.Yellow = 30
strokeColor.CMYK.Black = 0
appRef.ActiveDocument.Selection.Stroke strokeColor, 5, 1, 15, 75, False
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,
false)

Inverting selections

You can use the
can work on the rest of the document, layer or channel while protecting the selection.
AS:
VBS:
JS:

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 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
stroke (Stroke/stroke())
invert (Invert/invert())
invert selection of current document
selRef.Invert
selRef.invert()
Working with the Photoshop Object Model 44
command of the
command of the
Selection
object to stroke
Selection
object to a selection so you

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents