cancel button(function) not woking
Hi all,
Here is my script for export pdf for selecting preset, it is working, but not working to cancel the action, still exporting PDF for canceling action
what's the bug, any one can help me?
var mydoc = app.documents.item(0);
var myPresets = app.pdfExportPresets.everyItem().name;
myPresets.unshift("- Select Preset - ");
var myWin = new Window('dialog', 'PDF Export Presets');
myWin.orientation = 'row';
with(myWin){
myWin.sText = add('statictext', undefined, '');
myWin.myPDFExport = add('dropdownlist',undefined,undefined,{items:myPresets});
myWin.myPDFExport.selection = ("items:myPresets");
myWin.btnOK = add('button', undefined, 'OK');
myWin.btnCancel = add('button', undefined, 'Cancel');
};
myWin.center();
var myWindow = myWin.show();
var myOutFolderPathName = "/Users/Desktop/Watched Folder/Out/"; //Please change your path as per requirement
var myPDFFilePath;
myPreset = myWin.myPDFExport.selection.index;
var InDJobOption = app.pdfExportPresets[myPreset-1];
myPDFFilePath = myOutFolderPathName+"/"+app.documents[0].name.split(".indd")[0].split(".INDD")[0]+".pdf";
app.documents[0].exportFile (ExportFormat.pdfType, myPDFFilePath, false, InDJobOption);
if(myWindow == true && myWin.myPDFExport){
var myPreset = app.pdfExportPresets.item;
myFile = File(+"PDF files: *.pdf");
}
thanks in advance,
simon
