ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

dockable script UI question

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Dirk de Jong
dockable script UI question
on Nov 2, 2017 at 4:36:17 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'],&#092;
myButton: Button{text:'Button Name'},&#092;
}"

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.


Return to posts index

Andrei Popa
Re: dockable script UI question
on Nov 2, 2017 at 8:22:12 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.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]