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

dialog returns boolean as false when it should be true

New Here ,
Apr 03, 2017 Apr 03, 2017

Copy link to clipboard

Copied

Hi - I made the following code to test a problem I am having with a dialog inside a do-while loop. It seems the second time the loop runs, the boolean value comes back as false when it should be true. Clicking "OK" on my dialog should cause another round of the loop, but instead the loop is exited and the last bit of code runs. I'm testing this in the latest version of InDesign CC 2017. Any help would be much appreciated. Thanks!

var dlg = app.dialogs.add();

var bln=true;

do{

    alert("value of bln "+bln);

    bln = dlg.show();

    alert("now value of bln "+bln);

    }

while(bln == true)

alert("done");

TOPICS
Scripting

Views

448

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

Guru , Apr 03, 2017 Apr 03, 2017

Hi Simon

app dialogs were succeeded by SUI about a decade ago, SUI is in it's dying stages, app dialogs are already dead.

Either use SUI or Work on CS6 were your code will work.

HTH

Trevor

Votes

Translate

Translate
Guru ,
Apr 03, 2017 Apr 03, 2017

Copy link to clipboard

Copied

Hi Simon

app dialogs were succeeded by SUI about a decade ago, SUI is in it's dying stages, app dialogs are already dead.

Either use SUI or Work on CS6 were your code will work.

HTH

Trevor

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
New Here ,
Apr 03, 2017 Apr 03, 2017

Copy link to clipboard

Copied

Thanks Trevor. That's very helpful. The only books I could find to teach me are more than ten years old. Are there likely to be other areas where the code is obsolete?

Cheers

Simon

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
Guru ,
Apr 04, 2017 Apr 04, 2017

Copy link to clipboard

Copied

There are several DOM elements that have changed  or been depreciated or introduced, there are lists of some of the changes.

I would recommend peter kahrel​ guides, SUI and GREP guides are excellent, he has on general InDesign scripting as well which I have not read but it's likely to be good too.

The adobe js manual is particularly useful as are the references here Where to locate the latest Indesign CC scripting documentation ?

For more advanced stuff there the toolkit guide see the link for more details

HTH

Trevor

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
New Here ,
Apr 04, 2017 Apr 04, 2017

Copy link to clipboard

Copied

LATEST

Awesome, will check out those links. Thanks so much for taking the time to help me along my way, much appreciated!

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