I have a piece of code that selects the initial state (snapshot) of the active document.
I wonder if there exist a short way to achieve the same goal.
Here is the actual script:
var myDoc = app.activeDocument.name;
var doc = app.activeDocument.historyStates.length;
alert("History States : " + doc);
function firstStep(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putName(cTID('SnpS'), myDoc);
desc1.putReference(cTID('null'), ref1);
executeAction(cTID('slct'), desc1, dialogMode);
alert("Selected Initial State");
};
firstStep();
Thanks in advance