Adobe 23101764 Scripting Guide - Page 99
Filling a selection with a history state
UPC - 718659340025
View all Adobe 23101764 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 99 highlights
Scripting Photoshop 3 History object 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 gives 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; IMPORTANT: Reverting back to a previous history state does not remove any latter states from the history collection. Use the Purge command to remove latter states from the history collection as shown below: AS: purge history caches VB: appRef.Purge( psHistoryCaches) JS: app.purge( PurgeTarget.HISTORYCACHES ); 3.16.1 Filling a selection with a history state A history state can also be used to fill a selection. See section 3.12, "Selections" on page 81 for more information on working with selections. Photoshop CS Scripting Guide 95