Home Forums General XMetaL Discussion Undo/Redo clearing of a specific item Reply To: Undo/Redo clearing of a specific item


Reply to: Undo/Redo clearing of a specific item

In XMAX v6, is there a way to clear the last item in the undo stack, as opposed to the entire thing via UndoClear?

It is possible from the XMAX application, i.e. from outside of XMAX.  It is not possible from within a macro running inside of XMAX script engine.  To do from outside, take your XMAX instance from your application, I'll assume an HTML application with an object tag having an id=”XMAX” and Jscript:


This will rollback the last mutation the system did.  If you ran a macro previously, it would undo everything the macro did as one action. If you did a XMAX.Document.Paste(), it would undo the paste.

XMAX 7.0 has two APIs, BeginMutation & EndMutations, which to enable grouping a series of document mutations invoked from the outside of XMAX (i.e. not from a macro).  The whole idea here is to allow rolling back that grouping with a single call to Document.Undo(), or Redo() for that matter.

Related info can be read in this posting: [url=http://forums.xmetal.com/index.php/topic,550.msg2045.html]http://forums.xmetal.com/index.php/topic,550.msg2045.html[/url].