Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions My first Script UI has a bug and its making me crazy

  • My first Script UI has a bug and its making me crazy

    Posted by Vincenzo Imbimbo on June 7, 2022 at 9:00 am

    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);

    }


    Vincenzo Imbimbo replied 3 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    June 7, 2022 at 4:19 pm

    Maybe try to make it self invoking, like this

    (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();

    }

    })(this);

    I am not sure this will work. However, I have some advice for you. Use this webpage to make the UI. It’s by far the best and easiest way to create UI for After Effects

    ScriptUI Dialog Builder (joonas.me)

  • Vincenzo Imbimbo

    June 9, 2022 at 2:32 pm

    Thanks for your reply Andrei, unfortunately my script keeps having the same bug, I was hoping I wouldn’t have to rebuild everything from scratch but I’ll take a look at that ScriptUI Dialog Builder, thank you!!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy