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.
I think the only way to achieve your goal is to save the document, but if you save it to the desktop as a template, then open that (giving you an untitled copy) and then delete the template, you'll be where you want to be and the user won't realize the trick you played to flush the undo list.
Thanks Dave! I got the saving as template working and that wipes out the undos just like I need. Of course it doesn't help me in another case, but I will be work around that. Thanks again for the great idea!