I need to delete all snapshots and layer comps by a script
I need to delete all Snapshots and Layer Comps in current .psd by a script.
Photoshop CC 2017 and CS6.
Would be grateful for any idea!
I need to delete all Snapshots and Layer Comps in current .psd by a script.
Photoshop CC 2017 and CS6.
Would be grateful for any idea!
// 2017, use it at your own risk;
#target photoshop
if (app.documents.length > 0) {
try {
var myDocument = app.activeDocument;
myDocument.layerComps.removeAll();
var theStates = myDocument.historyStates;
for (m = theStates.length - 1; m >=0; m--) {
if (theStates
myDocument.activeHistoryState = theStates
delHist()
}
};
} catch (e) {}
};
function delHist() {
var desc20 = new ActionDescriptor();
var ref23 = new ActionReference();
ref23.putProperty( charIDToTypeID('HstS'), charIDToTypeID('CrnH') );
desc20.putReference( charIDToTypeID('null'), ref23 );
executeAction( charIDToTypeID('Dlt '), desc20, DialogModes.NO );
};
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.