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

Button stays active and no action taken ?

Advisor ,
Jan 07, 2017 Jan 07, 2017

Copy link to clipboard

Copied

When clicking on the 'Group Invert' button; the button remains active and nothing happens when the follow script is applied to a group.

var ui = new Window ("dialog");

var uiConvert = ui.add("button",undefined,"Group Invert");

var uiFind = ui.add("button",undefined,"Group Finder");

  ui.orientation = "row";

ui.show();

uiConvert.onClick = function() {

var mDoc = app.documents[0];

  var nGroup = mDoc.groupItems[0].selected;

if (nGroup >= 0) {

app.executeMenuCommand("ungroup");

}

};

TOPICS
Scripting

Views

678

Translate

Translate

Report

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

Engaged , Jan 08, 2017 Jan 08, 2017

ui.show() must be placed after uiConvert.onClick event handler:

var ui         = new Window("dialog");

var uiConvert  = ui.add("button", undefined, "Group Invert");

var uiFind     = ui.add("button", undefined, "Group Finder");

ui.orientation = "row";

uiConvert.onClick = function() {

  var mDoc   = app.documents[0];

  var nGroup = mDoc.groupItems[0].selected;

  if (nGroup >= 0) {

    app.executeMenuCommand("ungroup");

  }

}

ui.show();

everything else is good

Votes

Translate

Translate
Adobe
Engaged ,
Jan 08, 2017 Jan 08, 2017

Copy link to clipboard

Copied

ui.show() must be placed after uiConvert.onClick event handler:

var ui         = new Window("dialog");

var uiConvert  = ui.add("button", undefined, "Group Invert");

var uiFind     = ui.add("button", undefined, "Group Finder");

ui.orientation = "row";

uiConvert.onClick = function() {

  var mDoc   = app.documents[0];

  var nGroup = mDoc.groupItems[0].selected;

  if (nGroup >= 0) {

    app.executeMenuCommand("ungroup");

  }

}

ui.show();

everything else is good

Votes

Translate

Translate

Report

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
Advisor ,
Jan 08, 2017 Jan 08, 2017

Copy link to clipboard

Copied

The UI has to encapsulate everything

Although why does the button after triggered stay enabled or "blue" ?

Votes

Translate

Translate

Report

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
Engaged ,
Jan 08, 2017 Jan 08, 2017

Copy link to clipboard

Copied

I think it's a good questions to Adobe developers

Votes

Translate

Translate

Report

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
Advisor ,
Jan 08, 2017 Jan 08, 2017

Copy link to clipboard

Copied

Oh, maybe they can answer ?

Votes

Translate

Translate

Report

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
Engaged ,
Jan 08, 2017 Jan 08, 2017

Copy link to clipboard

Copied

I think that behaviour of event handlers and function Window.show() - it's a norm for Illustrator ExtendScript.

The blue color of the last pushed button does not a bug - it's a feature of the Illustrator cc2017 !

Votes

Translate

Translate

Report

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
Advisor ,
Jan 08, 2017 Jan 08, 2017

Copy link to clipboard

Copied

LATEST

Thanks for the tip

Votes

Translate

Translate

Report

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