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

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

  • June 4, 2009
  • 1 reply
  • 12409 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

Participant
November 17, 2010

I tried it in CS4 on my laptop running Vista x86 and on my desktop running Vista x64 and I consistently have found the same bug. Even if the script that is called by doScript() is simply an alert it will ruin the undos when set to fastEntireScript.

However, in CS5 I have unable to produce it. Maybe it was fixed .


Has anyone any idea how to fix the undo after the fastEntireScript broke it? I have some scripts which really need to use the fastEntireScript option for reasons of efficiency.

I've tried running a second script using a different option to see if it would restore functionality, but no joy as yet.

This is a real shame, as the option to 'suppress' Undo, or to at least put it all in one step, is something we've all wanted for a long time

Mike