Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all articles
Browse latest Browse all 2143

Problem with app.beginUndoGroup

$
0
0

Hello, I'm creating a new script but I have a problem with app.beginUndoGroup.

So in this script I've a button, after pressing it, the script creates some layers and the button turn from enabled to disabled.

The script is something like this:

 

...........
var res =
"Group {\            orientation: 'column' ,\            alignment: ['fill','top'],\            buttonsGrp: Group {\                                createLayersBtn: Button{text:'Create layers'},\                                   }\
}\

............
main.grp.buttonsGrp.createLayersBtn.enabled = true;
main.grp.buttonsGrp.createLayersBtn.onClick = function()
{   app.beginUndoGroup("Add layers")  //CREATE SOME LAYERS//   ......  main.grp.buttonsGrp.createLayersBtn.enabled = false;  app.endUndoGroup();
}

 

 

It works fine: after creating some layers the button is disabled, but if I make an undo, all layers are deleted but the button doesn't turn to enabled.

How can I fix it? thank you in advance!


Viewing all articles
Browse latest Browse all 2143

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>