Skip to content

CompoundPathItems

app.activeDocument.activeLayer.compoundPathItems

A collection of CompoundPathItem objects.


app.activeDocument.activeLayer.compoundPathItems.length

The number of objects in the collection.

Number; read-only.


app.activeDocument.activeLayer.compoundPathItems.parent

The parent of this collection (either a Layer or a GroupItem).

Object; read-only.


app.activeDocument.activeLayer.compoundPathItems.typename

The class name of the referenced object.

String; read-only.


app.activeDocument.activeLayer.compoundPathItems.add()

Creates a new CompoundPathItem.

CompoundPathItem


app.activeDocument.activeLayer.compoundPathItems.getByName(name)

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

ParameterTypeDescription
nameStringName of element to get

CompoundPathItem


app.activeDocument.activeLayer.compoundPathItems.index(itemKey)

Gets an element from the collection.

ParameterTypeDescription
itemKeyString, NumberString or number key

CompoundPathItem


app.activeDocument.activeLayer.compoundPathItems.removeAll()

Deletes all elements in this collection.

Nothing.


// Counts all compound path items in layer 1 of the current document
if (app.documents.length > 0) {
var doc = app.activeDocument;
var numCompoundPaths = doc.layers[0].compoundPathItems.length;
}