Skip to main content
Mateo666
Known Participant
May 16, 2019
Answered

Is it possible to group action without having an undo related .... ?

  • May 16, 2019
  • 1 reply
  • 718 views

im writing a CEP panel extension and trying to sync a sourceText keyPoint with a text marker.

When the user changes the text marker I move the sourceText keyPoint so it stays aligned

The problem is doing so generates a lot of undo history.

Is it possible to group actions without having an undo generated ?

Or is there a better way to align a keyPoint sourceText with the value of a text marker?

thanks

Mat

This topic has been closed for replies.
Correct answer Justin Taylor-Hyper Brew

I want to hide the undo group. Not create it.

let say I do this

   var stProps = layer.property("sourceText");

   stProps.setValueAtTime(startTime, new TextDocument(startTxt));

   stProps.setValueAtTime(endTime, new TextDocument(endTxt));

but I don't want to have this in an undo nor in a group.

I have a polling mechanism running a script every 500 ms

and don't want to have undo action based on what's happening in that script.


Gotcha, pass an empty string into the undo group, and it will be hidden from the undo history:

app.beginUndoGroup('');

// your code

app.endUndoGroup();

1 reply

Justin Taylor-Hyper Brew
Community Expert
Community Expert
May 16, 2019

Use Undo Groups to group all your actions into one undo:

app.beginUndoGroup("My Function");

// your code

app.endUndoGroup();

More info on that here: http://docs.aenhancers.com/general/application/?highlight=undo#app-beginundogroup

Mateo666
Mateo666Author
Known Participant
May 16, 2019

That's what im doing right now and trying to prevent.

I want to group some actions and not have them in one undo.

like if it was not undoable

Justin Taylor-Hyper Brew
Community Expert
Community Expert
May 16, 2019

Have you tried just making multiple undo groups for your desired level of complexity? If it's not working, can you post a snippet of what you're trying to group?