Click to cancel Export to PDF
hi Everybody,
I have problem with my script..... when i Click "OK" button, PDF export... also when I click "Cancel" button, also PDF export.... ( i assume, button Cancel should be in seperate group).
can anybody tweak this... so when i click Cancel.... PDF should not export...
var myCapsWin = new Window('dialog', 'Export PDF with preflight errors');
myCapsWin.orientation = 'row';
myCapsWin.minimumSize = [230, 50];
with(myCapsWin){
myCapsWin.optPNL = add('panel');
myCapsWin.optPNL.orientation = 'row';
myCapsWin.btnGrp = add('group');
myCapsWin.btnGrp.orientation = 'row';
with(myCapsWin.btnGrp){
myCapsWin.btnGrp.btnOK = add('button', undefined, 'OK');
myCapsWin.btnGrp.btnCancel = add('button', undefined, 'Cancel');
}
};
myCapsWin.center();
var myCaps = myCapsWin.show();
if(myCaps == true){
var myBar = new Window('palette', ' Export PDF Generating....', undefined, {closeButton:false, maximizeButton:true, minimizeButton:true });
myBar.add('progressbar',undefined, 1, 100);
myBar.children[0].preferredSize = [250,15];
myBar.show();
myBar.children[0].value = myBar.children[0].value+10;
var myPDFFilePath;
var InDJobOption = app.pdfExportPresets;
myBar.children[0].value = myBar.children[0].value+10;
myBar.children[0].value = myBar.children[0].value+20;
myPDFFilePath = myOutFolderPathName+"/"+app.documents[0].name.split(".indd")[0].split(".INDD")[0]+".pdf";
myBar.children[0].value = myBar.children[0].value+20;
app.documents[0].exportFile (ExportFormat.pdfType, myPDFFilePath, false, myJobOptionName);
myBar.children[0].value = myBar.children[0].value+100;
myBar.close();
$.sleep(10);
exit(0);
}
}}
thanks
shil..