Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to undo complete script action by only undoing 1 time

Explorer ,
Jul 12, 2023 Jul 12, 2023

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? 

TOPICS
Expressions , How to , Scripting
784
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Jul 12, 2023 Jul 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

Translate
Enthusiast ,
Jul 12, 2023 Jul 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 12, 2023 Jul 12, 2023
LATEST

Thank you so much. It worked.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines