7 Replies Latest reply on Oct 20, 2015 7:43 AM by Scorpio17523

    Keyboard shortcuts wont work in .saveDialog or .saveDlg

    Scorpio17523 Level 1

      Hey all,

       

      First of all, thanks for taking the time to read this and help. It's greatly appreciated.

       

      I'm working on a simple script where it will export an InDesign file to PDF, opening up a save dialog window for the user to select the location to save to and give it a name.

       

      We have another system that generates the name for us as we simply just copy and paste it into the window. This works fine when doing a normal export using InDesign's built in way of doing it, but when I try and do it via script, keyboard shortcuts don't seem to work.

       

      Any ideas why?

       

      Here is an example of code at current..

       

      //========================== Export PDF ================================//
      
      var myDoc = app.activeDocument;
      var myFolderName = myDoc.filePath;
      
      
      var myDocumentName = myDoc.name.slice (0, -5);
      
      
      //Apply a name to the PDF file based on the INDD file, but without the .indd extension
      //var myFileName = myFolderName + "/" + myDocumentName;
      var myFileName = File(myDoc.name);
      var myFile = myFileName.saveDlg("Please insert a file name");
        
      //Do not open the PDF Export dialog box. Set "false" to "true" if you want the dialog box.
      myDoc.exportFile(ExportFormat.pdfType, myFile, false, "Email");
      
      //========================== End  - Export PDF Script ================================//
      

       

       

      Now I'm no expert at scripting, I look everything up, follow tutorials and try to piece things together (learn by doing), so any help would be greatly appreciated, especially if you can explain your answer in simple english

       

      If I haven't made myself clear, just let me know and I'll explain it another way.

       

      Thanks in advance.