Edit in GitHubLog an issue

Layers

一个集合数组访问在一个文档上的图层列表。 同时也提供ExtendScript中熟悉的方法,如 getByName

Copied to your clipboard
1// 遍历最前面的文件的所有顶层
2app.activeDocument.layers.forEach(h => console.log(h.name));

Indexable

▪ [index: number]: Layer

用来访问集合中的图层。

Copied to your clipboard
1// 遍历最前面的文件的所有顶层
2app.activeDocument.layers.forEach(h => console.log(h.name));

Properties

名称类型访问最低版本描述
lengthnumberR22.5Number of Layer elements in this collection.
typenamestringR22.5The name for this object collection: Layers.

Methods

add

22.5

async : Promise<Layer>

创建一个新层

Copied to your clipboard
let newDoc1 = await app.activeDocument.layers.add();

getByName

22.5

Layer

找到第一个具有匹配名称的层

Parameters

名称类型
namestring
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2023 Adobe. All rights reserved.