Skip to content

Brushes

app.activeDocument.brushes

A collection of Brush objects in a document.


app.activeDocument.brushes.length

The number of objects in the collection

Number; read-only.


app.activeDocument.brushes.parent

The document that contains this brushes collection.

Object; read-only.


app.activeDocument.brushes.typename

The class name of the referenced object.

String; read-only.


app.activeDocument.brushes.getByName(name)

Gets the first element in the collection with the specified name.

ParameterTypeDescription
nameStringName of element to get

Brush


app.activeDocument.brushes.index(itemKey)

Gets an element from the collection.

ParameterTypeDescription
itemKeyString, NumberString or number key

Brush


// Counts all brushes in the active document
if (app.documents.length > 0) {
var numberOfBrushes = app.activeDocument.brushes.length;
}