historyStates is...not working for me.
I generate different variations of graphics (A,B, and C) from one PSD. So sometimes I want to revert the file to make sure none of my changes are still hanging around. This code works great
Code: Select allapp.activeDocument.activeHistoryState = app.activeDocument.historyStates[0];
Unless nothing has been done (i.e. I don't generate A, but then I need to generate B). Then anything I call to historyStates errors like this
Error 8800: General Photoshop error occurred. This functionality may not be available in this version of Photoshop.
- The command “Get” is not currently available.
I've tried getting the length of HistoryStates but that errors in the same way. Is there any way to know if something has been done to a document so I can dynamically call changing the activeHistoryState?
HistoryStates erroring if nothing has been done
-
BrianC
HistoryStates erroring if nothing has been done
What's even stranger is, if I set a breakpoint and use the Data Browser in ExtendScript toolkit, I can see that historyStates length = 2 on open. But if I set it to
Code: Select all if (app.activeDocument.historyStates.length>=2){
app.activeDocument.activeHistoryState = app.activeDocument.historyStates[0];
}
I get an error on the first line.
Code: Select all if (app.activeDocument.historyStates.length>=2){
app.activeDocument.activeHistoryState = app.activeDocument.historyStates[0];
}
I get an error on the first line.
-
Mike Hale
HistoryStates erroring if nothing has been done
If you want to revert the document then I suggest you use Action Manager.
Code: Select allexecuteAction( charIDToTypeID( "Rvrt" ), undefined, DialogModes.NO );
Code: Select allexecuteAction( charIDToTypeID( "Rvrt" ), undefined, DialogModes.NO );