The selected area of the document or layer.
Go to Property Listing | Method Listing
clear, copy, cut, selectBorder, contract, fill, stroke, selectAll, deselect, select, expand, feather, grow, invert, similar, smooth, store, load, translate, translateBoundary, rotate, rotateBoundary, resize, resizeBoundary, makeWorkPath
undefined clear ()
Clears the selection and does not copy it to the clipboard.
undefined contract (by:UnitValue)
Contracts the selection.
Parameter |
Type |
Description |
---|---|---|
by |
The amount to contract the selection. |
undefined copy ([merge:Boolean])
Copies the selection to the clipboard.
Parameter |
Type |
Description |
---|---|---|
merge |
If true the copy includes all visible layers. If false, copies only from the current layer. |
undefined cut ()
Cuts the current selection to the clipboard.
undefined deselect ()
Deselects the current selection.
undefined expand (by:UnitValue)
Expands the selection.
Parameter |
Type |
Description |
---|---|---|
by |
The amount to expand the selection. |
undefined feather (by:UnitValue)
Feathers the edges of the selection.
Parameter |
Type |
Description |
---|---|---|
by |
The amount to feather the edge. |
undefined fill (fillType:Varies, [mode:ColorBlendMode=ColorBlendMode], [opacity:Int=Int], [preserveTransparency:Boolean])
Fills the selection.
Parameter |
Type |
Description |
---|---|---|
fillType |
Varies |
The color or history state with which to fill the object. |
mode |
The color blend mode. (default: ColorBlendMode.NORMAL) |
|
opacity |
Int (range 1 - 100) |
The opacity as a percentage. Range: 1 to 100. (default: 100) |
preserveTransparency |
If true, perserves transparencies. |
undefined grow (tolerance:Int, antiAlias:Boolean)
Grows the selection to include all adjacent pixels falling within the specified tolerance range.
Parameter |
Type |
Description |
---|---|---|
tolerance |
Int (range 0 - 255) |
The tolerance range. Range: 0 to 255. |
antiAlias |
If true, anti-aliasing is used. |
undefined invert ()
Inverts the selection.
undefined load (from:Channel, [combination:SelectionType=SelectionType], [inverting:Boolean=Boolean])
Loads the selection from the specified channel.
Parameter |
Type |
Description |
---|---|---|
from |
The channel to load the selection from. |
|
combination |
How to combine the channel contents with the existing selection. (default: SelectionType.REPLACE) |
|
inverting |
If true, selects the inverse of the channel contents. (default: false) |
undefined makeWorkPath ([tolerance:Number])
Makes this selection item the workpath for this document.
Parameter |
Type |
Description |
---|---|---|
tolerance |
The tolerance in pixels. |
undefined resize ([horizontal:Number=Number], [vertical:Number=Number], [anchor:AnchorPosition=AnchorPosition])
Resizes the selected area to the specified dimensions and anchor position.
Parameter |
Type |
Description |
---|---|---|
horizontal |
The amount to scale the selection horizontally (as a percentage). (default: 100) |
|
vertical |
The amount to scale the selection vertically (as a percentage). (default: 100) |
|
anchor |
The point to scale around. (default: AnchorPosition.MIDDLECENTER) |
undefined resizeBoundary ([horizontal:Number=Number], [vertical:Number=Number], [anchor:AnchorPosition=AnchorPosition])
Scales the boundary of the selection.
Parameter |
Type |
Description |
---|---|---|
horizontal |
The amount to scale the object horizontally (as a percentage). (default: 100) |
|
vertical |
The amount to scale the object vertically (as a percentage). (default: 100) |
|
anchor |
The point to scale around. (default: AnchorPosition.MIDDLECENTER) |
undefined rotate (angle:Number, [anchor:AnchorPosition=AnchorPosition])
Rotates the object.
Parameter |
Type |
Description |
---|---|---|
angle |
The number of degrees to rotate the object. |
|
anchor |
The point to rotate about. (default: AnchorPosition.MIDDLECENTER) |
undefined rotateBoundary (angle:Number, [anchor:AnchorPosition=AnchorPosition])
Rotates the boundary of the selection.
Parameter |
Type |
Description |
---|---|---|
angle |
The rotation angle (in degrees) |
|
anchor |
The point to rotate about. (default: AnchorPosition.MIDDLECENTER) |
undefined select (region:Array of Varies, [type:SelectionType=SelectionType], [feather:Number=Number], [antiAlias:Boolean=Boolean])
Selects the specified region.
Parameter |
Type |
Description |
---|---|---|
region |
Array of Varies |
Array of x and y coordinates that describe the corners of the selection, in the format [[x1, y1], [x2,y2],[x3, y3], [x4,y4]] |
type |
The method for combining the new selection with the existing selection. (default: SelectionType.REPLACE) |
|
feather |
The feather amount. (default: 0) |
|
antiAlias |
If true, anti-aliasing is used. (default: true) |
undefined selectAll ()
Selects the entire layer.
undefined selectBorder (width:UnitValue)
Selects the selection border only (in the specified width); subsequent actions do not affect the selected area within the borders.
Parameter |
Type |
Description |
---|---|---|
width |
The width of the border selection. |
undefined similar (tolerance:Int, antiAlias:Boolean)
Grows the selection to include pixels throughout the image falling within the tolerance range.
Parameter |
Type |
Description |
---|---|---|
tolerance |
Int (range 0 - 255) |
The tolerance range. Range: 0 to 255. |
antiAlias |
If true, anti-aliasing is used. |
undefined smooth (radius:Int)
Cleans up stray pixels left inside or outside a color-based selection (within the radius specified in pixels).
Parameter |
Type |
Description |
---|---|---|
radius |
Int (range 0 - 100) |
The sample radius in pixels. Range: 0 to 100. |
undefined store (into:Channel, [combination:SelectionType=SelectionType])
Saves the selection as a channel.
Parameter |
Type |
Description |
---|---|---|
into |
The channel to save the selection to. |
|
combination |
How to add the selection to the existing contents of the channel. (default: SelectionType.REPLACE) |
undefined stroke (strokeColor:Varies, width:Int, [location:StrokeLocation=StrokeLocation], [mode:ColorBlendMode=ColorBlendMode], [opacity:Int=Int], [preserveTransparency:Boolean])
Strokes the selection.
Parameter |
Type |
Description |
---|---|---|
strokeColor |
Varies |
The color to stroke the selection with. |
width |
Int |
The stroke width. |
location |
The stroke location. (default: StrokeLocation.CENTER) |
|
mode |
The color blend mode. (default: ColorBlendMode.NORMAL) |
|
opacity |
Int (range 1 - 100) |
The opacity of the stroke color as a percentage. Range: 1 to 100. (default: 100) |
preserveTransparency |
If true, preserves transparency. |
undefined translate ([deltaX:UnitValue], [deltaY:UnitValue])
Moves the object relative to its current position.
Parameter |
Type |
Description |
---|---|---|
deltaX |
The amount to move the object horizontally. |
|
deltaY |
The amount to move the object vertically. |
undefined translateBoundary ([deltaX:UnitValue], [deltaY:UnitValue])
Moves the boundary of selection relative to its current position.
Document.selection