Skip to content

Variables

app.activeDocument.variables

The collection of Variable objects in the document.

For an example of how to create variables, see Using variables and datasets.


app.activeDocument.variables.length

The number of variables in the document

Number; read-only.


app.activeDocument.variables.parent

The object that contains the collection of variables

Object; read-only.


app.activeDocument.variables.typename

The class name of the referenced object.

String; read-only.


app.activeDocument.variables.add()

Adds a new variable to the collection.

Variable


app.activeDocument.variables.getByName(name)

Get the first element in the collection with the provided name.

ParameterTypeDescription
nameStringName of element to get

Variable


app.activeDocument.variables.index(itemKey)

Gets an element from the collection.

ParameterTypeDescription
itemKeyString, NumberString or number key

Variable


app.activeDocument.variables.removeAll()

Deletes all elements in this collection.

Nothing.