Copy link to clipboard
Copied
I have relied on using w.show() == 2 to determine if a cancel button was pressed when using ScriptUI dialogs in PS, AI and ID. Now in Bridge, it seems like the cancel button does not work, including explicitly assigning a button as the window.cancelElement;
I worked around this by adding a click event to set a property which is read when the window.show() returns something other than 2, and returning null when the property is present vs missing.
But, am I just doing something wrong, or is this a known thing in the world of Bride scripting?
Copy link to clipboard
Copied
I normally just let it default, this works for me in Bridge 2017...
var w = new Window("dialog","test");
var can = w.add("button",undefined,"Cancel");
var process = w.add("button",undefined,"Process");
process.onClick=function(){
alert("Processs button pressed");
w.close(0);
}
var result = w.show();
alert("Result = " + result);