2 Replies Latest reply on Aug 11, 2008 9:06 PM by (Daniel_Rodney)

    [JS] Undo question

    Level 1
      I have a script that create a document and then sets it up. If the user hits Undo it will mess up some of the setup (such as script labels, etc.) I have inquired before and am under the impression that a script cannot put all of it's actions into one undo (which would be great). But in this case I want to remove the undo function. I do not want the user to be able to undo. Any ideas of how to do this?

      I do not want to save to do a File > Save As to wipe the undo history since this is building a new document and I'd rather not force them to save it right away.

      I did find something in the CS2 documentation about a Document preference enableUndo. I've tried using myDocumentName. enableUndo = false but that creates an error (and I don't see this in the CS3 documentation).

      For this script I need to support CS2 and CS3.

      FYI, a workaround I'd rather not use, but will if I must, is to have the script create a text frame on the page that says DO NOT DO ANOTHER UNDO and then delete it before the script finishes. That way if the users presses undo that frame will appear telling them to not press it again. But I'd like a better way and a more fullproof way.

      Thanks in advance for any help,
      Dan