var bt = new BridgeTalk();
bt.target = "photoshop";
bt.body = "var palette = " + fn.toString() + "; palette();"
bt.send();
function fn() {
var dialog = new Window("palette", undefined, undefined, { closeButton: true });
dialog.text = "Dialog";
dialog.orientation = "column";
dialog.alignChildren = ["center", "top"];
dialog.spacing = 10;
dialog.margins = 16;
var button1 = dialog.add("button", undefined, undefined, { name: "button1" });
button1.text = "";
button1.onClick = function () { adicionar_mais() };
dialog.show();
}