Copy link to clipboard
Copied
Hi,
I need to revert my indd document to the last saved state in the end of the script and suppress the dialog box for it. When I run this line:
myDoc.revert();
I get the dialog box.
So I tryed:
myDoc.revertToProject();
and it gives me an error. What do I need to do to make it work.
Thank you for your help.
Yulia
Yuliaart wrote:
If I could just close the document without saving any changes and without showing the dialog would be even better. But I don't see closing with the option of not saving. How can I do that.
Thank you,
Yulia.
myDoc.close(SaveOptions.no)
Copy link to clipboard
Copied
Close without saving, then re-open?
(Alternatively, although it would seem to me it does the exact same thing, you could try suppressing the dialogs before calling revert().)
Copy link to clipboard
Copied
If I could just close the document without saving any changes and without showing the dialog would be even better. But I don't see closing with the option of not saving. How can I do that.
Thank you,
Yulia.
Copy link to clipboard
Copied
Yuliaart wrote:
If I could just close the document without saving any changes and without showing the dialog would be even better. But I don't see closing with the option of not saving. How can I do that.
Thank you,
Yulia.
myDoc.close(SaveOptions.no)
Copy link to clipboard
Copied
Beautiful.
Thank you.
Yulia
Copy link to clipboard
Copied
This might work. I have not tested it. I use try/catch to make sure that the last line runs and turns on user interaction.
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;
try{
myDoc.revert();
} catch(error) {}
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
Copy link to clipboard
Copied
Tried this in one of my own scripts - Worked perfectly. Thanks
Copy link to clipboard
Copied
Urgent help needed. I accidentally pressed "save" in my Indesign CS4 file after deleting most of the pages. I can't undo right away and the revert is always in grey after I restarted Indesign or the whole computer. Is there a way that I can revert to my last saved state of the file? Where do you put all the scripts you both mentioned above?
I have an urgent deadline for this job. It will take me a long time to recreate all the changes again. Please help asap!
Copy link to clipboard
Copied
It sounds like you are talking about a different situation. Once you close a doc after saving, there's nothing to revert to...
Sorry.
Harbs