4 Replies Latest reply on Jul 18, 2014 6:05 AM by Dapeamel

    Help to set activepath on my function

    Dapeamel Level 1

      Hello guys,

       

      Chinnadk helped me with this function

       

      my question is..

      I wonder how do I add a default path so each time the File.openDialog comes up it navigastes to ("C:/test/xxx example")

      see my function below

       

       

      function copyfiles()
        {
        var _files = File.openDialog("Select indesign files","*.indd",true),  
        TargetFolder= Folder.selectDialog("Select the target folder"),  
        _parent = _files[0].parent.toString().replace(_files[0].parent.parent,"");  
        new Folder(TargetFolder+ _parent).create();  
        var filenames = "";  
        var txtfile = new File(TargetFolder+ _parent + "/myFileLog.txt");  
        for(var i=0;i<_files.length;i++)  
        {  
        _files[i].copy(new File(TargetFolder+ _parent + "/" + _files[i].name));  
        filenames +=_files[i].name + "\r";  
        }  
        txtfile.open('w');  
        txtfile.write(filenames);  
        txtfile.close();  
        //txtfile.execute();   öppnar textfilen
        //#include "/Kommuni/LaRe/LareAUTO/341542/scripts/interface/scripts/KABPDFExport_1.jsx" 
        // $.writeln(myFile.displayName);  // just for write the data in console  
      
      
      }
      
      

       

       

      thank you in advance

       

      All good Adobe Members!

       

      Cheers