undo() does work, but spawns pointless error
// ----
function inner() {
var doc = app.activeDocument;
var i = doc.layers.length;
while (i-->1) {
doc.layers[i].remove();
}
}
function outher() {
app.doScript(inner,ScriptLanguage.JAVASCRIPT,[],UndoModes.SCRIPT_REQUEST,'outher');
alert("pause");
app.activeDocument.undo(); //<- wrong error, it actually works
}
app.doScript(outher,ScriptLanguage.JAVASCRIPT,[],UndoModes.ENTIRE_SCRIPT,'inner');
// ----
Also, this error is not ingnorable: if you put undo() in a try-clause, it doesnt work.
Alsoalso, the different undo-modes (https://developer.adobe.com/indesign/dom/api/u/UndoModes/) are NOT sufficient explained. At least write some whole sentences on how they actually differ.
2
votes
Rhavin Grobert
shared this idea