Edit in GitHubLog an issue

LayerComps

A collections class allowing for array access into a document's Layer Comps

Access this collection through Document.layerComps property. For example, following adds a new Layer Comp to the collection:

Copied to your clipboard
const comp = await app.activeDocument.layerComps.add();

Indexable

▪ [index: number]: LayerComp

Used to access the Layer Comp in the collection

Access this collection through Document.layerComps property. For example, following adds a new Layer Comp to the collection:

Copied to your clipboard
const comp = await app.activeDocument.layerComps.add();

Properties

NameTypeAccessMin VersionDescription
length
number
R
24.0
Number of LayerComp elements in this collection
parent
R
24.0
The owner document of this Layer comp collection
typename
string
R
24.0
The name for this object collection: LayerComps

Methods

add

24.0

Promise<LayerComp>

Adds a Layer Comp to the document's collection. If no options are given, only visibility will be recorded.

Note: This command will fail if the document is flat, that is, only a Background and no other layers.

Parameters

NameTypeDefault valueDescription
options
{}
An optional object literal containing key/value pairs as described by LayerCompCreateOptions javascript const options = { name: "mockup", comment: "First attempt", visibility: true, position: true }; await require('photoshop').app.activeDocument.layerComps.add(options);

getAllByName

24.0

LayerComp[]

Get all Layer Comps by name

Parameters

NameType
name
string

removeAll

24.0

Promise<void>

Clears all Layer Comps from this collection

Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.