Skip to content

GraphicStyles

app.activeDocument.graphicStyles

A collection of GraphicStyle objects in a document.


app.activeDocument.graphicStyles.length

The number of graphic styles in the document.

Number; read-only.


app.activeDocument.graphicStyles.parent

The document that contains this graphic styles collection.

Document; read-only.


app.activeDocument.graphicStyles.typename

The class name of the referenced object.

String; read-only.


app.activeDocument.graphicStyles.getByName(name)

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

ParameterTypeDescription
nameStringName of element to get

GraphicStyle


app.activeDocument.graphicStyles.index(itemKey)

Gets an element from the collection.

ParameterTypeDescription
itemKeyString, NumberString or number key

GraphicStyle


app.activeDocument.graphicStyles.removeAll()

Removes all elements in the referenced collection.

Nothing.


// Counts the number of graphic styles in the active document
// and stores result in numberOfStyles
if (app.documents.length > 0) {
var numberOfStyles = app.activeDocument.graphicStyles.length;
}