A layer object.
Layers may contain nested layers, which are called sublayers in the user interface. The layer object contains all of the page items in the specific layer as elements. Your script can access page items as elements of either the layer object or the document object.
Go to Property Listing | Method Listing
Property |
Type |
Access |
Description |
---|---|---|---|
read/write |
If true, the layer's contents and settings are locked. |
||
read/write |
The mode to use when compositing an object. |
||
UnitRect |
readonly |
If the Layer is a layer set, this property returns a reference to the corresponding layer set object. |
|
UnitRect |
readonly |
Bounding rectangle of the Layer not including effects. |
|
Int |
readonly |
The unique ID of this layer. |
|
Int |
readonly |
The layer index sans layer groups, how Photoshop would index them. |
|
readonly |
The layers linked to this layer. |
||
read/write |
The name of the layer. |
||
Number (range 0 - 100) |
read/write |
The layer's master opacity (as a percentage). Range: 0.0 to 100.0. |
|
readonly |
The object's container. |
||
readonly |
The class name of the object. |
||
read/write |
If true, the layer is visible. |
||
readonly |
XMP metadata associated with the Layer. |
Layer duplicate (relativeObject:Object, insertionLocation:ElementPlacement)
Duplicate this object.
Parameter |
Type |
Description |
---|---|---|
relativeObject |
||
insertionLocation |
undefined link (with:Layer)
Links the layer with the specified layer.
Parameter |
Type |
Description |
---|---|---|
with |
The layer to link to. |
Layer move (relativeObject:Object, insertionLocation:ElementPlacement)
Move the object.
Parameter |
Type |
Description |
---|---|---|
relativeObject |
||
insertionLocation |
undefined moveToEnd ([layerSet:LayerSet])
...
Parameter |
Type |
Description |
---|---|---|
layerSet |
undefined remove ()
Deletes this object.
undefined removeAll ()
Deletes all elements.
undefined resize ([horizontal:Number=Number], [vertical:Number=Number], [anchor:AnchorPosition=AnchorPosition])
Scales the object.
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 resize about. (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 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 unlink ()
Unlinks the layer.