Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual page 61

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
Stroking the Selection Border
The following examples use the
object to stroke the boundaries around the current selection and set the stroke color and width.
Note:
The transparency parameter cannot be used for background layers.
AS
stroke selection of current document using color ¬
VBS
selRef.Stroke strokeColor, 5, 1, 15, 75, False
JS
app.activeDocument.selection.stroke (strokeColor, 2,
Inverting Selections
You can use the i
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 CS2 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
change 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 appRef
Set appRef = CreateObject("Photoshop.Application")
Dim selRef
Set selRef = appRef.ActiveDocument.Selection
selRef.Expand 5
stroke (Stroke/stroke())
{class:CMYK color,cyan:20, magenta:50, yellow:30, black:0}¬
width 5 location inside blend mode vivid light opacity 75 ¬
without preserving transparency
StrokeLocation.OUTSIDE, ColorBlendMode.VIVIDLIGHT, 75,
false)
nvert/Invert/invert()
'Setting Application Preferences' on page 46
Photoshop CS2
command/method of the
command/method of the Selection object to a selection so you
Scripting Photoshop CS2
Selection
for examples of how to
57

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents