Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual page 65

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
In a script, you can access a
property of the
state or to fill a
The following examples revert the document contained in the variable
properties it had when it was first saved. Using history states in this fashion gives you the ability to undo
modifications to the document.
AS
set current history state of current document to history state 1 ¬
of current document
VBS
docRef.ActiveHistoryState = docRef.HistoryStates(0)
JS
docRef.activeHistoryState = docRef.historyStates[0]
Note:
Reverting back to a previous history state does not remove any latter states from the history
collection. Use the
shown below:
AS
purge history caches
VBS
appRef.Purge(2) 'for psPurgeTarget --> 2 (psHistoryCaches)
JS
app.purge(PurgeTarget.HISTORYCACHES)
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
VBS
Set savedState = docRef.ActiveHistoryState
docRef.ApplyMotionBlur 20, 20
docRef.ActiveHistoryState = savedState
JS
savedState = docRef.activeHistoryState
docRef.applyMotionBlur( 20, 20 )
docRef.activeHistoryState = savedState
Using Notifier Objects
You use the
automatically create a new document when you open the application, you could tie a script that creates a
Document
Document
object. You can use a
Document
object.
Selection
command to remove latter states from the
Purge
object to tie an event to a script. For example, if you would like Photoshop CS2 to
Notifier
object to an
Open Application
Photoshop CS2
object's history states using the
HistoryStates
event.
Scripting Photoshop CS2
object, which is a
HistoryStates
object to reset a document to a previous
back to the form and
docRef
History States
61
collection as

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents