Page 1 of 1

undo

Posted: January 17th, 2005, 4:16 am
by miki
Does anyone know how to perform an "undo" from within a script?

Miki

Posted: January 17th, 2005, 7:33 am
by byronnash
When saying undo, do you mean you want to be able to undo your script?
If so, just put these lines and the beginning and end of your script.

app.beginUndoGroup("Your undo text here");
//put your script in between here
app.endUndoGroup();

Posted: January 17th, 2005, 9:42 am
by miki
No, I mean I actually want to do the undo from within my script!

I want to make a GUI which includes its own "undo" button.
Any ideas?

Posted: January 17th, 2005, 9:46 am
by byronnash
Sorry, nothing comes to mind on that. You are wanting to undo a normal AE action that was done before the script was launched? I'll let you know if I run across anything. This would be a good application for a scriptlistener like Photoshop has.

Posted: January 22nd, 2005, 11:29 am
by Impudent1
Just a thought but you could parse the bits you wish to effect and save those as vars for a "return to default" type button.

You can take a look at the calculator script I created. Perhaps the memory add/return/clear bits will help you get some sort of internal undo buffer for your script