Adobe After Effects Forum
Update panel when user switches Comps [scripting]
Update panel when user switches Comps [scripting]
by Jay Brown on Mar 6, 2018 at 12:45:15 am

I've been trying to figure out a way for my dockable Panels to update when the user switch Comps. This is what I've come up with which seems to work pretty well. However I'm still a total novice at scripting and I just want to make sure that this is safe/the appropriate way of doing this. Thanks -J

MyComp = app.project.activeItem;
sTN = app.scheduleTask("checkComp()", 500, true);

checkComp = function(){
try{
test = w.size; // if this fails then the pallete (w) is actually closed and the task is canceled
if(MyComp != app.project.activeItem ){ // if MyComp value has changed
MyComp = app.project.activeItem;
alert("You switched Comps"); // replace with function
}
}catch(err){
app.cancelTask(sTN);
};
}






© CreativeCOW.net