5 Replies Latest reply on May 23, 2014 5:59 AM by tlumbis

    Remove file name prefix when exporting to PDF

    tlumbis Level 1



      I found a script here which exports the active document as a PDF to the desktop.

      I would like for it to change the file name such that the first two characters are removed.



      The existing file name is: X_pagelayout.indd

      I would like this script to create a PDF named: pagelayout.pdf



      Your help is very much appreciated.



      var myFolder = "~\Desktop";

      var myDoc = app.activeDocument; 

      var myDocname = myDoc.name.split(".indd");

      myDoc.exportFile(ExportFormat.PDF_TYPE, File(new File(myFolder+"\\" + myDocname.join(".pdf"))));