3 Replies Latest reply on Oct 8, 2015 1:00 AM by sreekarthik.k@gmail.com

    how to copy all files from one folder to another?

    virender_CTS

      hi All,

       

      i am using this code but files were not copied.

      var sourceFolder = new Folder("/Users/admin5/Desktop/Fonts");

      var targetFolder = new Folder("/Users/admin5/Desktop/123/");

      myFiles = sourceFolder.getFiles();

       

      for (var i=0; i < myFiles.length; i++)

      {
      //alert(myFiles[i]);

      var myFile2 = new File(myFiles[i]);    // alert(myFile2.fsName);
      if (myFile2.copy (targetFolder))

      {

      alert("yes");

      }

       

      else
      {

      alert("no");

      }

      }