Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Can I use Esc key to cancel a palette script

Participant ,
Jun 22, 2022 Jun 22, 2022

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. 

TOPICS
Scripting , Tools
313
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Jun 24, 2022 Jun 24, 2022

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.

Translate
Adobe
Participant ,
Jun 24, 2022 Jun 24, 2022
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines