Adobe Photoshop CS6
JavaScript Scripting Reference JavaScript Object Reference 166
Selection
The selected area of a document or layer. Access through the Document.selection property. For example:
app.activeDocument.selection.fill(app.foregroundColor)
Many of the properties and methods use the UnitValue type, which combines measurement values with
the measurement unit. For information about this type, see the JavaScript Tools Guide.
Properties
Methods
Property Value type What it is
bounds
array of UnitValue
Read-only. The bounding rectangle of the entire selection.
parent
Document
Read-only. The object's container.
solid
boolean
Read-only. True if the bounding rectangle is a solid.
typename
string
Read-only. The class name of the referenced selection
object.
Method Parameter type Returns What it does
clear
()
Clears the selection and
does not copy it to the
clipboard.
contract
(by)
UnitValue
Contracts (reduces) the
selection by the specified
amount.
copy
([merge])
boolean
Copies the selection to the
clipboard. When the
optional argument is used
and set to
true, a merged
copy is performed (all visible
layers in the selection are
copied).
cut
()
Clears the current selection
and copies it to the
clipboard.
deselect
()
Deselects the current
selection.
expand
(by)
UnitValue
Expands the selection by the
specified amount.
feather
(by)
UnitValue
Feathers the edges of the
selection by the specified
amount.
Comments to this Manuals