Skip to main content
TᴀW
Legend
June 4, 2009
Answered

doScript (UndoModes) breaks InDesign's Undo (CS4)

  • June 4, 2009
  • 1 reply
  • 12433 views

I wrote a little script. To make sure that I can undo it all in one go, I used:

app.doScript(main, undefined, undefined, UndoModes.fastEntireScript,"My script");

Once the script completes, InDesign's regular undo is broken. It no longer undoes separate steps, but will only revert to the point before which the script has been run.

What can I add at the end of the script to return things to normal?

Thanks,

Ariel

This topic has been closed for replies.
Correct answer Harbs.

If you use try/catch in your script, you should probably use

UndoModes.entireScript instead.

The reason is kind of complicated...

HTH,

Harbs

1 reply

Harbs.
Harbs.Correct answer
Legend
June 4, 2009

If you use try/catch in your script, you should probably use

UndoModes.entireScript instead.

The reason is kind of complicated...

HTH,

Harbs

Marc Autret
Legend
September 21, 2010

Harbs. wrote:

If you use try/catch in your script, you should probably use 

UndoModes.entireScript instead.

The reason is kind of complicated...

Hi Harbs,

I would love to have more details on that complicated reason. Can you tell me more?

[For performance purpose, one of my script needs the fastEntireScript mode, but I use a number of try...catch... So?]

Thanks!

Marc

Inspiring
August 22, 2011

My attempt to summarize this discussion:

http://www.indiscripts.com/post/2011/08/notes-on-fastentirescript-undo-mode

@+

Marc


That was an excellent write up. And the was a great find with the workaround! Wrapping the fastEntireScript and an entireScript was ingenius.