
Photoshop 7.0 Scripting Guide
72
Scripting Photoshop
Selections
3
JS:
var fillColor = new SolidColor();
fillColor.rgb.red = 255;
fillColor.rgb.green = 0;
fillColor.rgb.blue = 0;
activeDocument.selection.fill( fillColor, ColorBlendMode.VIVIDLIGHT,
25, false);
To fill the current selection with the 10th item in the history state, you would write:
AS:
fill selection of current document with contents history state 10 ¬
of current document
VB:
selRef.Fill docRef.HistoryStates(10)
JS:
selRef.fill( activeDocument.historyStates[9]);
3.11.6 Rotating selections
You can rotate either the contents of a selection or the selection boundary itself. The first set of
examples below show how to rotate an existing selection 45 degrees.
AS:
rotate selection of current document angle 45
VB:
docRef.Selection.Rotate(45);
JS:
active.Document.selection.rotate(45);
To rotate the boundary of an existing selection:
AS:
rotate boundary selection of current document angle 45
VB:
docRef.Selection.RotateBoundary(45);
JS:
activeDocument.selection.rotateBoundary(45);