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

How to undo complete script action by only undoing 1 time

Explorer ,
Jul 12, 2023 Jul 12, 2023

Copy link to clipboard

Copied

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

Views

155

Translate

Translate

Report

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

Votes

Translate

Translate
Enthusiast ,
Jul 12, 2023 Jul 12, 2023

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

Thank you so much. It worked.

Votes

Translate

Translate

Report

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