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

Unable to create window

Contributor ,
Jan 17, 2017 Jan 17, 2017

Copy link to clipboard

Copied

Hi,

     I have created window for a process and it was working fine.  Recently  getting error in one machine (Mac 10.9.5). I don't know the reason for the error.  Script is not running.  Dialog is not created.  But its working in other machine.

Screen Shot 2017-01-17 at 20.57.37.png

If i click the "OK" button, then i get the below error.

Screen Shot 2017-01-17 at 20.57.43.png

Code:

     var myDlg = new Window('dialog', 'Dialog Title');

     roundTypePanel = myDlg.add('panel', undefined, "Round ");

     roundTypePanel.orientation = 'row';

     var rad1 = roundTypePanel.add('radiobutton', [156,75,325,105], "Round 1");

     var rad2 = roundTypePanel.add('radiobutton', [156,75,325,105], "Round 2");

     rad1.value = true;

     roundType = 1;

     myDlg.show();

Can anyone help me??

- Sudha K

TOPICS
Scripting

Views

621

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 17, 2017 Jan 17, 2017

Copy link to clipboard

Copied

Hi Sudha,

Your code is working fine.

var myDlg = new Window('dialog', 'Dialog Title');

     roundTypePanel = myDlg.add('panel', undefined, "Round ");

     roundTypePanel.orientation = 'row';

     var rad1 = roundTypePanel.add('radiobutton', [156,75,325,105], "Round 1");

     var rad2 = roundTypePanel.add('radiobutton', [156,75,325,105], "Round 2");

     var myOkButton = myDlg.add ("button", undefined, "OK");

     var myCancelButton = myDlg.add ("button", undefined, "Cancel");

     rad1.value ==true;

     roundType = 1;

     myDlg.show();

Thanks,

Prabu G

Thanks,
Prabu
Design smarter, faster, and bolder with InDesign scripting.

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
People's Champ ,
Jan 17, 2017 Jan 17, 2017

Copy link to clipboard

Copied

I confirm it works at my place. Maybe you should trash your preferences.

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
Contributor ,
Jan 17, 2017 Jan 17, 2017

Copy link to clipboard

Copied

Thank you... I will check and let you know...

Why should we remove the preferences?? For me also its working in another system. I don't know the reason for this...

Whats the issue in this??

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
People's Champ ,
Jan 18, 2017 Jan 18, 2017

Copy link to clipboard

Copied

Well your code works for most of the users who tried it. You have only one desk where it doesn't and it's on your machine.

So I am guessing maybe something is wrong with your own configuration. So trashing preferences is generally a good way to start indesign from scratch and get back to the standard configuration.

Have a try. At least it will discard this reason. Do you know the first rule in computer support ? …restart to see if problem is gone.

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
Contributor ,
Jan 26, 2017 Jan 26, 2017

Copy link to clipboard

Copied

Hi,

     Sorry for the late reply...

     I cleared the InDesign preference and then run the script, its working.  If I restart the computer after cleared the InDesign preference, its throwing the same error.  I don't know the reason for this issue and how to run the script.

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
People's Champ ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

Don't you have any startup scripts which could corrupt the app ? Worst case scenario a new install from scratch.

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
Contributor ,
Jan 28, 2017 Jan 28, 2017

Copy link to clipboard

Copied

Thank you for your reply... I will check and come back...

How to check startup scripts?? Any scripts placed inside the folder "startup scripts"??

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
People's Champ ,
Jan 30, 2017 Jan 30, 2017

Copy link to clipboard

Copied

Any scripts placed inside the folder "startup scripts"??

yes that's the idea. Obvioulsy something is messing your app. It could be a startup script or a plugin that once called makes things dirty unless you clean preferences till next call.

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
Contributor ,
Feb 01, 2017 Feb 01, 2017

Copy link to clipboard

Copied

There is no scripts inside the "startup scripts" folder.

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
People's Champ ,
Feb 01, 2017 Feb 01, 2017

Copy link to clipboard

Copied

Any third parties plug-in ?

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
Contributor ,
Feb 01, 2017 Feb 01, 2017

Copy link to clipboard

Copied

Any third party plug-in for an InDesign application?

There is no third party plug-in and startup scripts.

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
People's Champ ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

Well, no more hints to give.

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
Community Expert ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

LATEST

Hm. Would shielding the code be of use?

Like using another targetengine—not main—and put it into an anonymous function?

#targetengine sudha

var runThis = function()

{

    var myDlg = new Window('dialog', 'Dialog Title');

    roundTypePanel = myDlg.add('panel', undefined, "Round ");

    roundTypePanel.orientation = 'row';

    var rad1 = roundTypePanel.add('radiobutton', [156,75,325,105], "Round 1");

    var rad2 = roundTypePanel.add('radiobutton', [156,75,325,105], "Round 2");

    var myOkButton = myDlg.add ("button", undefined, "OK");

    var myCancelButton = myDlg.add ("button", undefined, "Cancel");

    rad1.value = true;

    roundType = 1;

    myDlg.show();

  

};

runThis();

FWIW: Sudha's code is running well with my tests on InDesign CC 2017 on Mac OSX 10.10.5.

With or without using a different targetengine:

Sudha-Dialog-working-example.png

Regards,
Uwe

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