画笔
app.activeDocument.brushes
文档中的画笔对象集合。
Brushes.length
Section titled “Brushes.length”app.activeDocument.brushes.length
集合中的对象数量。
数字;只读。
Brushes.parent
Section titled “Brushes.parent”app.activeDocument.brushes.parent
包含此画笔集合的文档。
对象;只读。
Brushes.typename
Section titled “Brushes.typename”app.activeDocument.brushes.typename
引用对象的类名。
字符串;只读。
Brushes.getByName()
Section titled “Brushes.getByName()”app.activeDocument.brushes.getByName(name)
获取集合中具有指定名称的第一个元素。
参数 | 类型 | 描述 |
---|---|---|
name | 字符串 | 要获取的元素的名称 |
Brushes.index()
Section titled “Brushes.index()”app.activeDocument.brushes.index(itemKey)
从集合中获取一个元素。
参数 | 类型 | 描述 |
---|---|---|
itemKey | 字符串, 数字 | 字符串或数字键 |
统计画笔数量
Section titled “统计画笔数量”// 统计活动文档中的所有画笔数量
if (app.documents.length > 0) { var numberOfBrushes = app.activeDocument.brushes.length;}