revert to original document state error

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

lukasz

revert to original document state error

Post by lukasz »

it seems to randomly error out. half the time it works, the other it doesn't? very confusing. this is the code I use:

Code: Select all                            docRef = app.activeDocument
                            myState = docRef.historyStates[0];
                            docRef.activeHistoryState = myState;

it will say this functionality may not be available for this version of photoshop.
I noticed I have an active selection. will this cause a problem?

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

txuku

revert to original document state error

Post by txuku »

Hello lukasz

Strange ..... the code seems correct??
maboroshi

revert to original document state error

Post by maboroshi »

The above works for me, but I worry if it will work once you've gone past the history limit and want to go back to the original state.
This one line will run the "revert" command:
Code: Select allexecuteAction( charIDToTypeID( "Rvrt" ), undefined, DialogModes.NO );