Copy link to clipboard
Copied
Hi,
I know it works with a "dialog", but I'm looking for a trick to use (Esc) key to exit a "palette".
I made a script palette that contains buttons of the most important scripts I use everyday. I can run different scripts smoothly.
The only thing that bothers me is the way to close it then open it and then close it again and so on.
I tried to use it as a "dialog" instead of "palette" but the script buttons won't work unless the main "dialog" script is closed first. This means I will open and close the script for every button click.
Kindly help.
I found a workaround. i just created a hidden cancelElement button.
////////////////////Close Button
var but = win.add("button", undefined, "Close");
but.size = [0,0];
win.cancelElement = but;
but.onClick = function() {
win.close();
}
Works for me anyway.
Copy link to clipboard
Copied
I found a workaround. i just created a hidden cancelElement button.
////////////////////Close Button
var but = win.add("button", undefined, "Close");
but.size = [0,0];
win.cancelElement = but;
but.onClick = function() {
win.close();
}
Works for me anyway.