Packagecom.adobe.photoshop
Classpublic class Layer
InheritanceLayer Inheritance PhotoshopHostObject Inheritance CSHostObject Inheritance flash.utils.Proxy
Subclasses ArtLayer, LayerSet

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.



Public Properties
 PropertyDefined By
  allLocked : Boolean
If true, the layer's contents and settings are locked.
Layer
  blendMode : BlendMode
The mode to use when compositing an object.
Layer
  bounds : Array
[read-only] Bounding rectangle of the Layer.
Layer
 InheritedhostObjectDelegate : HostObject
Getter for the delegate
CSHostObject
  linkedLayers : Array
[read-only] The layers linked to this layer.
Layer
  name : String
The name of the layer.
Layer
  opacity : Number
The layer's master opacity (as a percentage).
Layer
 Inheritedparent : *
[read-only]
PhotoshopHostObject
  visible : Boolean
If true, the layer is visible.
Layer
  xmpMetadata : XmpMetadata
[read-only] The XMP properties of the document.
Layer
Public Methods
 MethodDefined By
  
duplicate(relativeObject:Object = null, insertionLocation:ElementPlacement = null):Layer
create a duplicate of the object
Layer
 Inherited
filterArgsForHBAPI(args:Array):Array
[static] Function to clean up the argument list and put it into a format that makes sense for HBAPI.
CSHostObject
 Inherited
filterSingleObjectForHBAPI(value:Object):Object
[static]
CSHostObject
 Inherited
getClassObjectForName(className:String):HostObject
[static] This returns a "Class" object, meaning, a HostObject that can be used to make static function calls or get static properties
CSHostObject
 Inherited
getSpecialTranslation(className:String, ho:HostObject, expectedReturnType:Class, ownerName:String):*
[static]
CSHostObject
 Inherited
hostCall(name:String, expectedReturnType:Class, rawargs:Array):*
Encapsulates a function call to the host
CSHostObject
 Inherited
hostCallStatic(className:String, methodName:String, expectedReturnType:Class, rawargs:Array):*
[static] Implements a safe call of a static method on the host
CSHostObject
 Inherited
hostGet(name:String, expectedReturnType:Class):*
Encapsulates a property get to the host
CSHostObject
 Inherited
hostGetIndex(idx:Object, expectedReturnType:Class):*
Encapsulates a indexed get to the host
CSHostObject
 Inherited
hostGetStatic(className:String, propertyName:String, expectedReturnType:Class):*
[static] Implements a safe get of a static property on the host Used by for instance, all the enum implementations.
CSHostObject
 Inherited
hostSet(name:String, rawvalue:*):void
Encapsulates a property set to the host
CSHostObject
 Inherited
hostSetStatic(className:String, propertyName:String, rawvalue:*):*
[static] Implements a safe set of a static property on the host
CSHostObject
 Inherited
isDescendedFrom(clz:Class, ancClass:Class):Boolean
[static] Efficiently determines whether or not one class descends from another in inheritance hierarchy- class relationships are cached by the ClassUtils implementation- (uses org.as3commons lib to quickly discover class hierarchy.
CSHostObject
  
link(_with:Layer):void
Links the layer with the specified layer.
Layer
  
move(relativeObject:Object, insertionLocation:ElementPlacement):void
move the object
Layer
  
remove():void
delete the object
Layer
 Inherited
replaceDefaultArgs(args:Array, defaultArgs:Array):Array
Function to tidy up arguments prior to call.
CSHostObject
  
resize(horizontal:Number = 100, vertical:Number = 100, anchor:AnchorPosition = null):void
Scales the object.
Layer
  
rotate(angle:Number, anchor:AnchorPosition = null):void
Rotates the object.
Layer
  
translate(deltaX:String = null, deltaY:String = null):void
Moves the object relative to its current position.
Layer
  
unlink():void
Unlinks the layer.
Layer
 Inherited
wrapReturnedHostObject(rawObject:Object, expectedReturnType:Class, client:CSHostObject, propertyName:String):*
[static] Method used on static/normal get/ hostcalls
CSHostObject
Protected Methods
 MethodDefined By
 Inherited
createWithArgs(args:Array):void
CSHostObject
 Inherited
hostCreate(args:Array):void
CSHostObject
Property Detail
allLockedproperty
allLocked:Boolean

If true, the layer's contents and settings are locked.


Implementation
    public function get allLocked():Boolean
    public function set allLocked(value:Boolean):void
blendModeproperty 
blendMode:BlendMode

The mode to use when compositing an object.


Implementation
    public function get blendMode():BlendMode
    public function set blendMode(value:BlendMode):void
boundsproperty 
bounds:Array  [read-only]

Bounding rectangle of the Layer.


Implementation
    public function get bounds():Array
linkedLayersproperty 
linkedLayers:Array  [read-only]

The layers linked to this layer.


Implementation
    public function get linkedLayers():Array
nameproperty 
name:String

The name of the layer.


Implementation
    public function get name():String
    public function set name(value:String):void
opacityproperty 
opacity:Number

The layer's master opacity (as a percentage). Range: 0.0 to 100.0. ( 0.0 - 100.0 )


Implementation
    public function get opacity():Number
    public function set opacity(value:Number):void
visibleproperty 
visible:Boolean

If true, the layer is visible.


Implementation
    public function get visible():Boolean
    public function set visible(value:Boolean):void
xmpMetadataproperty 
xmpMetadata:XmpMetadata  [read-only]

The XMP properties of the document. The Camera RAW settings are stored here.


Implementation
    public function get xmpMetadata():XmpMetadata
Method Detail
duplicate()method
public function duplicate(relativeObject:Object = null, insertionLocation:ElementPlacement = null):Layer

create a duplicate of the object

Parameters

relativeObject:Object (default = null) — (Object)
 
insertionLocation:ElementPlacement (default = null) — (com.adobe.photoshop.ElementPlacement) ( default: ElementPlacement.INSIDE )

Returns
Layer
link()method 
public function link(_with:Layer):void

Links the layer with the specified layer.

Parameters

_with:Layer — (com.adobe.photoshop.Layer) The layer to link to.

move()method 
public function move(relativeObject:Object, insertionLocation:ElementPlacement):void

move the object

Parameters

relativeObject:Object — (Object)
 
insertionLocation:ElementPlacement — (com.adobe.photoshop.ElementPlacement)

remove()method 
public function remove():void

delete the object

resize()method 
public function resize(horizontal:Number = 100, vertical:Number = 100, anchor:AnchorPosition = null):void

Scales the object.

Parameters

horizontal:Number (default = 100) — (Number) The amount to scale the object horizontally (as a percentage). ( default: 100.0 )
 
vertical:Number (default = 100) — (Number) The amount to scale the object vertically (as a percentage). ( default: 100.0 )
 
anchor:AnchorPosition (default = null) — (com.adobe.photoshop.AnchorPosition) The point to resize about. ( default: AnchorPosition.MIDDLECENTER )

rotate()method 
public function rotate(angle:Number, anchor:AnchorPosition = null):void

Rotates the object.

Parameters

angle:Number — (Number) The number of degrees to rotate the object.
 
anchor:AnchorPosition (default = null) — (com.adobe.photoshop.AnchorPosition) The point to rotate about. ( default: AnchorPosition.MIDDLECENTER )

translate()method 
public function translate(deltaX:String = null, deltaY:String = null):void

Moves the object relative to its current position.

Parameters

deltaX:String (default = null) — (String) The amount to move the object horizontally.
 
deltaY:String (default = null) — (String) The amount to move the object vertically.

unlink()method 
public function unlink():void

Unlinks the layer.