A collections class allowing for array access into the applications list of layers on a document, while also providing familiar methods from ExtendScript, like getByName
getByName
https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layers/
// Iterate through all the top layers of frontmost documentapp.activeDocument.layers.forEach(h => console.log(h.name)); Copy
// Iterate through all the top layers of frontmost documentapp.activeDocument.layers.forEach(h => console.log(h.name));
Used to access the layers in the collection.
22.5
Number of Layer elements in this collection.
https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layers/#length
The name for this object collection: Layers.
https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layers/#typename
Create a new layer.
https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layers/#add
let newDoc1 = await app.activeDocument.layers.add(); Copy
let newDoc1 = await app.activeDocument.layers.add();
Find the first layer with the matching name.
https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layers/#getbyname
A collections class allowing for array access into the applications list of layers on a document, while also providing familiar methods from ExtendScript, like
getByNameSee
https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layers/
Example