-
My first Script UI has a bug and its making me crazy
Hello guys, i’ve just created an script UI and its working fine but every time i close After Effects and open it again the script stops working, it became like a shell, buttons without any functionality, and i only got 2 options to make it work again, 1: close the script and open it again. 2: change the working space to any other and go back to my working space where i have the script. Is this something related to the code of my script? or is a bug of After Effects?
This is the main structure of my script, is anything wrong?
{ function myScript(thisObj){ function myScript_buildUI(thisObj){
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "MyScriptName", undefined, {resizeable: true, closeButton:true});
// Here goes the main function of the script //
myPanel.layout.layout(true);
return myPanel;
}
var myScriptPal = myScript_buildUI(thisObj);
if(myScriptPal != null && myScriptPal instanceof Window){
myScriptPal.center();
myScriptPal.show();
}
}
myScript(this);
}