2 Replies Latest reply on May 3, 2016 10:30 PM by BEGINNER_X

    Create Folder in Categories

    BEGINNER_X Level 3

      Hi All,

       

      I have request to create a Package for Indesign as per Version Folder Structure.

       

      But the condition is,

      if the path having Version_3 Folder, then the Package output is saved in that location only.  //First Preference

      or

      if the path having Version_2 Folder, then the package output is saved in that location only.  //Second Preference

      or

      if the path having Version_1 Folder, then the package output is saved in that location only   //Third Preference

       

      Trying Code:

      var myDoc = app.activeDocument;
      var myFilePath = myDoc.filePath + "";
      var myOutput_Name = myDoc.name.replace(/\.indd/gi, "")
      
      
      var myFinalPath = myFilePath.replace(/DOCUMENT/i, "CLIENT_ORIGINAL")
      
      
      var test3 = myFinalPath + "/VERSION_3";
      var test2 = myFinalPath + "/VERSION_2";
      var test1 = myFinalPath + "/VERSION_1";
      
      
      //-------------------------Help Needed Here only-----------------------------------
      if(Folder(test3.exists) != null){
              var to = new File(test2 + "/" + myOutput_Name);
          }
      
      
      else if(Folder(test2.exists) != null){
              var to = new File(test1 + "/" + myOutput_Name);
          }
      else if(Folder(test1.exists) != null){
              var to = new File(test1 + "/" + myOutput_Name);
          }
      //-------------------------Help Needed Here only-----------------------------------
      
      
      alert(to)
      var myOutput_Folder = Folder(to).create()
      //~ if(myOutput_Folder.exists == true)
      //~ {
      //~     myOutput_Folder.remove();
      //~     myOutput_Folder.create();
      //~     }
      
      
      //------------------Package Concept is started here-----------------
      app.activeDocument.packageForPrint (
              to,
              copyingFonts = true, 
              copyingLinkedGraphics = true,
              copyingProfiles = false,
              updatingGraphics = true,
              includingHiddenLayers = true,
              ignorePreflightErrors = true,
              creatingReport = false,
              versionComments = "comment",
              forceSave = true,
               );
      

       

      Thanks in Advance

      Siraj