Layers
一个集合数组访问在一个文档上的图层列表。
同时也提供ExtendScript中熟悉的方法,如 getByName
Copied to your clipboard1// 遍历最前面的文件的所有顶层2app.activeDocument.layers.forEach(h => console.log(h.name));
Indexable
▪ [index: number]: Layer
用来访问集合中的图层。
Copied to your clipboard1// 遍历最前面的文件的所有顶层2app.activeDocument.layers.forEach(h => console.log(h.name));
Properties
名称 | 类型 | 访问 | 最低版本 | 描述 |
---|---|---|---|---|
length | number | R | 22.5 | Number of Layer elements in this collection. |
typename | string | R | 22.5 | The name for this object collection: Layers. |
Methods
add
22.5async : Promise<Layer>
创建一个新层
Copied to your clipboardlet newDoc1 = await app.activeDocument.layers.add();
getByName
22.5找到第一个具有匹配名称的层
Parameters
名称 | 类型 |
---|---|
name | string |