Skip to main content
Known Participant
July 12, 2023
Answered

How to undo complete script action by only undoing 1 time

  • July 12, 2023
  • 1 reply
  • 653 views

I am new to writing scripts so if  I mention something incorrectly I am sorry

I wrote an after effects script that creates a shape layer and moves the created shape layer above the selected layer(s), the in and out points, and according to the selected layer(s) but I can't undo the whole script at one time I have to undo 4-5 time to undo the actions performed by the script completely

What do I need to add to the script so it can be undone in 1 time? 

This topic has been closed for replies.
Correct answer Paul Tuersley

You can do this by putting the code between app.beginUndoGroup() / app.endUndoGroup() methods:

 

app.beginUndoGroup("description that appears in undo menu");

< your code here >

app.endUndoGroup();

 

https://ae-scripting.docsforadobe.dev/general/application.html#app-beginundogroup

1 reply

Paul TuersleyCorrect answer
Inspiring
July 12, 2023

You can do this by putting the code between app.beginUndoGroup() / app.endUndoGroup() methods:

 

app.beginUndoGroup("description that appears in undo menu");

< your code here >

app.endUndoGroup();

 

https://ae-scripting.docsforadobe.dev/general/application.html#app-beginundogroup

phoenixixAuthor
Known Participant
July 12, 2023

Thank you so much. It worked.