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

ScriptUI Window cancelElement

Valorous Hero ,
Jul 20, 2017 Jul 20, 2017

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?

TOPICS
Scripting
380
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
Guide ,
Jul 20, 2017 Jul 20, 2017
LATEST

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);

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