HistoryStates

A collections class allowing for array access into a document's history states, while also providing familiar methods from ExtendScript, like getByName

// Iterate through all history states
app.activeDocument.historyStates.forEach(h => console.log(h.name));

// Find all snapshot history states
var snapshots = app.activeDocument.historyStates.filter(h => h.snapshot)

Indexable

▪ [index: number]: HistoryState

Used to access the history states in the collection.

// Iterate through all history states
app.activeDocument.historyStates.forEach(h => console.log(h.name));

// Find all snapshot history states
var snapshots = app.activeDocument.historyStates.filter(h => h.snapshot)

Properties

Name
Type
Access
Min Version
Description
length
number
R
22.5
Number of HistoryState elements in this collection.
parent
Document
R
22.5
The owner document of this HistoryState collection.

Methods

getByName

<span class="minversion" style="display: block; margin-bottom: -1em; margin-left: 36em; float:left; opacity:0.5;">22.5</span>

<br/> HistoryState

Find the first history state with the matching name.

Parameters

Name
Type
name
string