1 Reply Latest reply on Sep 3, 2009 9:36 AM by Peter Kahrel

    [JS CS4] Folder Path Problems

    unskempt

      The following script simply exports an EPS to the same folder as the InDesign document.

       

      How do I get it to export to a folder that is one level up.

       

      eg: C:\MyFiles\Docs is where the InDesign document is, but I want the EPS to export to C:\MyFiles

       

      The folder paths are not always this simple.

       

      _____________________________________________________________

      if(app.documents.length != 0)
      {
      var file = app.documents[0].fullName;
      var myFileName = file.fullName.replace(/\.indd$/i, ".eps");


      //EPS Export Settings
      app.epsExportPreferences.epsColor = EPSColorSpace.cmyk
      app.epsExportPreferences.dataFormat = DataFormat.binary
      app.epsExportPreferences.postscriptLevel = PostScriptLevels.level3
      app.epsExportPreferences.preview = PreviewTypes.tiffPreview
      app.epsExportPreferences.fontEmbedding = FontEmbedding.none
      app.epsExportPreferences.appliedFlattenerPreset = "[High Resolution]"

      //app.documents[0].exportFile(ExportFormat.epsType, File());
      app.documents[0].exportFile(ExportFormat.epsType, File(myFileName));


      alert("EPS Export done!")

      }

      else{
      alert("No documents are open!");
      }

      ________________________________________________________________

       

       

       

      Thanks