Gradients
Gradients
Section titled “Gradients”app.activeDocument.gradients
Description
Section titled “Description”A collection of Gradient objects in a document.
Properties
Section titled “Properties”Gradients.length
Section titled “Gradients.length”app.activeDocument.gradients.length
Description
Section titled “Description”The number of objects in the collection.
Number; read-only.
Gradients.parent
Section titled “Gradients.parent”app.activeDocument.gradients.parent
Description
Section titled “Description”The parent of this object.
Object; read-only.
Gradients.typename
Section titled “Gradients.typename”app.activeDocument.gradients.typename
Description
Section titled “Description”The class name of the referenced object.
String; read-only.
Methods
Section titled “Methods”Gradients.add()
Section titled “Gradients.add()”app.activeDocument.gradients.add()
Description
Section titled “Description”Creates a new Gradient
object.
Returns
Section titled “Returns”Gradients.getByName()
Section titled “Gradients.getByName()”app.activeDocument.gradients.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”Gradients.index()
Section titled “Gradients.index()”app.activeDocument.gradients.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”Gradients.removeAll()
Section titled “Gradients.removeAll()”app.activeDocument.gradients.removeAll()
Description
Section titled “Description”Deletes all elements in this collection.
Returns
Section titled “Returns”Nothing.
Example
Section titled “Example”Removing a gradient
Section titled “Removing a gradient”// Deletes the first gradient from the current documentif (app.documents.length > 0) { app.activeDocument.gradients[0].remove();}