Page 1 of 1

Implementing Undo for changes to a field made by a script

Posted: Wed Apr 17, 2013 1:30 am
by Mag
The Dictionary reds:
The undo command cannot be used to undo actions performed by a script. Only user actions can be undone. For example, if you use a script to change the text in a field, the undo command cannot reverse that change, but if the user edits text, you can use undo to reverse the action.
So I assume that there is not way to use the standard undo menu command to a change made by a script in a field, right? :oops:

Re: Usinf Undo for changes to a field made by a script

Posted: Wed Apr 17, 2013 3:46 am
by dunbarx
Hi.

This is correct.

The way I would get around it is to set a custom property with the most recent text, perhaps with a "textChanged" message or via a keyDown handler, and if you need to undo, you restore from that. Multiple undo's are possible that way, I suppose, but looks hairy.

Craig Newman