I have never done any InDesign scripting but it should be very similar to AE.
I see the UI flash up for a brief moment then disappear.
Here is the code, any ideas?
Thanks.
Phil
Code: Select all
var myPalette = buildUI(this);
if (myPalette != null && myPalette instanceof Window) {
myPalette.show()
}
function buildUI (thisObject) {
if (thisObject instanceof Panel) {
var myWindow = thisObject;
} else {
var myWindow = new Window ("palette", "My Window");
}
// alert( myWindow) ;
myWindow.myPanel = myWindow.add("group");
myWindow.myPanel.orientation = "column";
myWindow.myPanel.okButton = myWindow.myPanel.add("button");
myWindow.myPanel.okButton.text = "OK";
myWindow.myPanel.cancelButton = myWindow.myPanel.add("button");
myWindow.myPanel.cancelButton.text = "Cancel";
myWindow.layout.layout(true);
myWindow.layout.resize();
myWindow.myPanel.okButton.onClick = function () {
ok_pressed();
}
myWindow.myPanel.cancelButton.onClick = function () {
cancel_pressed();
}
return myWindow;
} //function buildUI ()
function ok_pressed(){;
alert ("ok");
}
function cancel_pressed(){;
alert ("cancelled");
}