Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Force revert in InDesign CS4 js

Participant ,
Nov 05, 2010 Nov 05, 2010

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

TOPICS
Scripting

Views

1.7K

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Nov 05, 2010 Nov 05, 2010
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)

Likes

Translate

Translate
LEGEND ,
Nov 05, 2010 Nov 05, 2010

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().)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 05, 2010 Nov 05, 2010

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 05, 2010 Nov 05, 2010

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)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 05, 2010 Nov 05, 2010

Copy link to clipboard

Copied

Beautiful.

Thank you.

Yulia

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 05, 2010 Nov 05, 2010

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;

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 25, 2021 May 25, 2021

Copy link to clipboard

Copied

LATEST

Tried this in one of my own scripts - Worked perfectly.  Thanks

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 26, 2011 Oct 26, 2011

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!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 26, 2011 Oct 26, 2011

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines