Edit in GitHubLog an issue

LayerComps

一个合集数组,允许对文档的图层进行访问。

通过 Document.layerComps 属性访问这个集合。例如,下面将一个新的图层组合添加到这个集合中。

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

Indexable

▪ [index: number]: LayerComp

用来访问集合中的 Layer Comp

通过 Document.layerComps 属性访问这个集合。比如说。 下面将一个新的Layer Comp添加到这个集合中。

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

Properties

名称类型访问最低版本描述
lengthnumberR24.0这个集合中的 LayerComp 元素的数量
parentDocumentR24.0LayerComp 集合的所有者文档
typenamestringR24.0这个对象集合的名称: LayerComps

Methods

add

24.0

Promise<LayerComp>

在文档的集合中添加一个 Layer Comp 如果没有选项,只记录可见性。

注意:如果文档为 未变更,即只有一个背景而没有其他图层,这个命令会失败。

Parameters

名称类型默认值描述
optionsLayerCompCreateOptions{}一个可选的对象字面,包含键/值对,如图所示 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[]

按名称获取所有图层组合

Parameters

名称类型
namestring

removeAll

24.0

Promise<void>

删除这个集合中的所有图层组合

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