doScript Execution Error with GUI
Dear all,
I am facing a problem, I made a dialog box and several Checkbox options in that, and for every checkbox i just wan to run an script.
but it shows an error after clicking ok button, The error is
"Can not handle the request because a modal dialog or alert is active"
here is my code
function ps()
{
var res =
"dialog{\
orientation:'column',\
alignChildren:'left',\
img:Image{\
size:[130,90]\
}\
xmlot:Panel\
{\
xml:Group{\
orientation:'row',\
s:StaticText {text:'Select For XML Export'}\
b: Checkbox{text:'Word Out From Index', alignment:'left'}, \
c: Checkbox{text:'Index Out With Page Number', alignment:'left'}, \
d: Checkbox{text:'XML Out', alignment:'left'}, \
}\
},\
buttons: Group { orientation: 'row', alignment: 'right', \
okBtn: Button { text:'OK', properties:{name:'ok'} }, \
cancelBtn: Button { text:'Cancel', properties:{name:'cancel'} } \
} \
}";
var win = new Window(res,"Utility");
win.center();
win.img.icon = File("/InDesign/logo.jpg");
win.buttons.okBtn.onClick = function ()
{
if(app.documents.count()>0)
{if(win.xmlot.xml.b.value==true)
{app.doScript (new File("/InDesign/wo.jsx"), ScriptLanguage.JAVASCRIPT);}
if(win.xmlot.xml.c.value==true)
{app.doScript (new File("/InDesign/Generation.jsx"), ScriptLanguage.JAVASCRIPT);}
if(win.xmlot.xml.d.value==true)
{app.doScript (new File("/InDesign/Export.jsx"), ScriptLanguage.JAVASCRIPT);}
}
}
win.buttons.cancelBtn.onClick = function (){
win.close (true);
}
win.show();
}