Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions dockable script UI question

  • dockable script UI question

    Posted by Dirk De jong on November 2, 2017 at 4:36 am

    elsewhere on this forum in a post from the past I found some useful code for creating a dockable script UI in AE – and modifying it so it only displays a single button it looks like this –

    {
    function myScript(thisObj) {
    function myScript_buildUI(thisObj) {
    var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "My Panel Name", [0, 0, 300, 300]);

    res="group{orientation:'column', alignment:['fill', 'fill'], alignChildren:['fill', 'fill'],\
    myButton: Button{text:'Button Name'},\
    }"

    myPanel.grp = myPanel.add(res);

    myPanel.layout.layout(true);
    myPanel.grp.minimumSize = myPanel.grp.size;
    myPanel.layout.resize();
    myPanel.onResizing = myPanel.onResize = function () {this.layout.resize();}

    return myPanel;
    }

    var myScriptPal = myScript_buildUI(thisObj);

    if ((myScriptPal != null) && (myScriptPal instanceof Window)) {
    myScriptPal.center();
    myScriptPal.show();
    }
    }

    myScript(this);
    }

    Previously, in a non dockable palette I have successfully created icon (image) based buttons defining them like this

    var button01 = myWin.add(“iconbutton”, undefined, “/Applications/Adobe After Effects CC 2017/Scripts/(subfolder)/button01Image.jpg”, “button01”)

    Now I would like to have icon buttons in my dockable UI but I so far have tried various ways of replacing the text button from the example code with my icon button but have not found how to do it successfully. Any help much appreciated.

    Andrei Popa replied 8 years, 6 months ago 2 Members · 1 Reply
  • 1 Reply
  • Andrei Popa

    November 2, 2017 at 8:22 am

    Under the myPanel.grp = myPanel.add(res); line add this
    var button01 = myPanel.grp.add("iconbutton", undefined, "/Applications/Adobe After Effects CC 2017/Scripts/(subfolder)/button01Image.jpg", "button01")

    Andrei
    My Envato portfolio.

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