1 Reply Latest reply on May 3, 2011 7:05 AM by Bernd Alheit

    Create a new folder using field data


      I'm running Adobe Pro 3D 8.1.0.  I have a script running in a combobox.  The script is working fine, but I want it to create a new folder if the folder doesn't exist then save the file into the new folder.  Below is my script for the combobox.




      // build file name
      var site = this.getField("siteName").valueAsString;
      var dd = this.getDate();
      var mm=this.getMonth()+1;
      var yyyy=this.getFullYear();
      return String(mm+"-"+dd+"-"+yyyy)


      var today = new Date();
      var gmtHours = -today.getTimezoneOffset()/60;
      var cstHours = today.getUTCHours() + gmtHours;
      var min = today.getUTCMinutes();
      var sec=today.getUTCSeconds();
      var timeStamp=today.defaultView() + "_" + cstHours + "-" + min + "-" + sec;
      var myFileName = site + "_" + timeStamp + ".pdf";
      // add folder name
      myFileName = "/f/file_test/" + myFileName
      myTrustedSpecialTaskFunc(this, myFileName);


      this.getField("docName").value = myFileName;




      I have tried the following within this script and on its own to try to create folders.  When I put it inside the above script, I do leave off the first line below.




      var site = this.getField("siteName").valueAsString;
      myFolder = new Folder ("/f/Testing/" + site);
      if (myFolder.exists == false){






      all help is appreciated!  Thanks!