Adobe 23101335 Scripting Guide - Page 80
History object
![]() |
UPC - 718659152833
View all Adobe 23101335 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 80 highlights
Scripting Photoshop 3 History object 3.15 History object Photoshop keeps a history of the actions that affect the appearance of documents. Each entry in the Photoshop History palette is considered a "History State." These states are accessable from document object and can be used to reset the document to a previous state. A history state can also be used to fill a selection. To set your document back to a particular state, set the document's current history state: AS: set current history state of current document to history state 1 ¬ of current document VB: docRef.ActiveHistoryState = docRef.HistoryStates(1) JS: docRef.activeHistoryState = docRef.historyStates[0]; The code above sets the current history state to the top history state that is in the History palette. Using history states in this fashion give you the ability to undo the actions that were taken to modify the document. The example below saves the current state, applies a filter, and then reverts back to the saved history state. AS: set savedState to current history state of current document filter current document using motion blur with options ¬ {angle:20, radius: 20} set current history state of current document to savedState VB: Set savedState = docRef.ActiveHistoryState docRef.ApplyMotionBlur 20, 20 docRef.ActiveHistoryState = savedState JS: savedState = docRef.activeHistoryState; docRef.applyMotionBlur( 20, 20 ); docRef.activeHistoryState = savedState; Photoshop 7.0 Scripting Guide 80
![](/manual_guide/products/adobe-23101335-scripting-guide-ce635ed/80.png)