0
Contributor
,
/t5/indesign-discussions/how-to-define-undo-isvalid/td-p/10473763
May 30, 2019
May 30, 2019
Copy link to clipboard
Copied
Hi experts,
if my script like this
app.activeDocument.undo();
for undo activeDocument last changed
but if it is nothing to undo it will give me an error;
how can make the script something like
if (app.activeDocument.undo.isValid)
{app.activeDocument.undo();}
???
thanks
regard
John
TOPICS
Scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Community Expert
,
May 30, 2019
May 30, 2019
Hi John,
Try the following
if(app.activeDocument.undoHistory.length)
app.activeDocument.undo();
-Manan
Community Expert
,
/t5/indesign-discussions/how-to-define-undo-isvalid/m-p/10473764#M143048
May 30, 2019
May 30, 2019
Copy link to clipboard
Copied
Hi John,
Try the following
if(app.activeDocument.undoHistory.length)
app.activeDocument.undo();
-Manan
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Johnwhite
AUTHOR
Contributor
,
LATEST
/t5/indesign-discussions/how-to-define-undo-isvalid/m-p/10473765#M143049
May 30, 2019
May 30, 2019
Copy link to clipboard
Copied
thank you Man,
thank so much.
John
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

