GraphicStyles
GraphicStyles
Section titled “GraphicStyles”app.activeDocument.graphicStyles
Description
Section titled “Description”A collection of GraphicStyle objects in a document.
Properties
Section titled “Properties”GraphicStyles.length
Section titled “GraphicStyles.length”app.activeDocument.graphicStyles.length
Description
Section titled “Description”The number of graphic styles in the document.
Number; read-only.
GraphicStyles.parent
Section titled “GraphicStyles.parent”app.activeDocument.graphicStyles.parent
Description
Section titled “Description”The document that contains this graphic styles collection.
Document; read-only.
GraphicStyles.typename
Section titled “GraphicStyles.typename”app.activeDocument.graphicStyles.typename
Description
Section titled “Description”The class name of the referenced object.
String; read-only.
Methods
Section titled “Methods”GraphicStyles.getByName()
Section titled “GraphicStyles.getByName()”app.activeDocument.graphicStyles.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”GraphicStyles.index()
Section titled “GraphicStyles.index()”app.activeDocument.graphicStyles.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”GraphicStyles.removeAll()
Section titled “GraphicStyles.removeAll()”app.activeDocument.graphicStyles.removeAll()
Description
Section titled “Description”Removes all elements in the referenced collection.
Returns
Section titled “Returns”Nothing.
Example
Section titled “Example”Counting graphics styles
Section titled “Counting graphics styles”// 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;}