-
dockable script UI question
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.