0 Replies Latest reply on Jan 7, 2016 4:56 AM by Sumit Bhingardive

    Problem in saving the document by creating FILE object in JSX - Indesign CC 2015

    Sumit Bhingardive


      I am trying to save an already saved Indesign document on another path using JSX but getting the below error:

      "cannot find the folder "Volumes/User/userName/Documents/FolderToSaveDoc/Test.indd"

      below is the code snippet I used for the same:

      var sWorkingCopyPath = sFileCachePath + sFileBaseNameWithExtention; //"User/userName/Documents/FolderToSaveDoc/Test.indd" 
      var oFileWorkingCopy = new File(sWorkingCopyPath);

      The path I provided is "User/userName/Documents/FolderToSaveDoc/Test.indd"  and used it to create a File object to save the document. But on executing the above lines, I am getting the  error as "cannot find the folder "Volumes/User/userName/Documents/FolderToSaveDoc/Test.indd". I don't know how 'Volumes' is getting appended to the given path.

      Please note that above code is working fine on a windows system,  but failing on mac.

      Also note that, if Instead of using the FILE object, if we use the below code snippet, the save works.

      var sWorkingCopyPath = sFileCachePath + sFileBaseNameWithExtention; //"User/userName/Documents/FolderToSaveDoc/Test.indd" 
      app.activeDocument.save(sWorkingCopyPath );


      Can some body tell the reason for this?