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.
If i click the "OK" button, then i get the below error.
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
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
Copy link to clipboard
Copied
I confirm it works at my place. Maybe you should trash your preferences.
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??
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.
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.
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.
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"??
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.
Copy link to clipboard
Copied
There is no scripts inside the "startup scripts" folder.
Copy link to clipboard
Copied
Any third parties plug-in ?
Copy link to clipboard
Copied
Any third party plug-in for an InDesign application?
There is no third party plug-in and startup scripts.
Copy link to clipboard
Copied
Well, no more hints to give.
Copy link to clipboard
Copied
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:
Regards,
Uwe