CompoundPathItems
CompoundPathItems
Section titled “CompoundPathItems”app.activeDocument.activeLayer.compoundPathItems
Description
Section titled “Description”A collection of CompoundPathItem objects.
Properties
Section titled “Properties”CompoundPathItems.length
Section titled “CompoundPathItems.length”app.activeDocument.activeLayer.compoundPathItems.length
Description
Section titled “Description”The number of objects in the collection.
Number; read-only.
CompoundPathItems.parent
Section titled “CompoundPathItems.parent”app.activeDocument.activeLayer.compoundPathItems.parent
Description
Section titled “Description”The parent of this collection (either a Layer
or a GroupItem
).
Object; read-only.
CompoundPathItems.typename
Section titled “CompoundPathItems.typename”app.activeDocument.activeLayer.compoundPathItems.typename
Description
Section titled “Description”The class name of the referenced object.
String; read-only.
Methods
Section titled “Methods”CompoundPathItems.add()
Section titled “CompoundPathItems.add()”app.activeDocument.activeLayer.compoundPathItems.add()
Description
Section titled “Description”Creates a new CompoundPathItem
.
Returns
Section titled “Returns”CompoundPathItems.getByName()
Section titled “CompoundPathItems.getByName()”app.activeDocument.activeLayer.compoundPathItems.getByName(name)
Description
Section titled “Description”Gets the first element in the collection with the specified name.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
name | String | Name of element to get |
Returns
Section titled “Returns”CompoundPathItems.index()
Section titled “CompoundPathItems.index()”app.activeDocument.activeLayer.compoundPathItems.index(itemKey)
Description
Section titled “Description”Gets an element from the collection.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
itemKey | String, Number | String or number key |
Returns
Section titled “Returns”CompoundPathItems.removeAll()
Section titled “CompoundPathItems.removeAll()”app.activeDocument.activeLayer.compoundPathItems.removeAll()
Description
Section titled “Description”Deletes all elements in this collection.
Returns
Section titled “Returns”Nothing.
Example
Section titled “Example”Counting compound paths
Section titled “Counting compound paths”// Counts all compound path items in layer 1 of the current documentif (app.documents.length > 0) { var doc = app.activeDocument; var numCompoundPaths = doc.layers[0].compoundPathItems.length;}