How to avoid repeating call when the panel has not been closed in script?
I have written two JSX scripts,
where clicking a button in panel A calls another script from panel B.
However, the current way of calling causes the panel to be repeated every time the button is clicked on panel A.
How can I avoid repeating the call when the panel has not been closed?
For example, if panel B's script is still running and the button on panel A is clicked again without closing it,
it should not repeat the call.
Here is an example code:
var panelA = new Window("palette", "PanelA", undefined);
var button = Apanel.add("button", undefined, "Button");
button.onClick = function() {
panelB();
}
panelA.show();
function panelB () {
var panelB = new Window("palette", "PanelB", undefined);
var button2 = PanelB.add("button", undefined, "Button2");
button2.onClick = function() {
alert("this is panelB")
}
panelB.show();
}
