Works like a charm,
How do I set a default path for the FileDialog?
here is a old code I used to do that with,
function CopyStep1() { var myPath = (File($.fileName).parent.parent.parent.fullName).split("/Kommuni/LaRe/LareAUTO/"); var jobName=(myPath[1]); // filtrera bort jobbnummret för att kunna plocka parrent from aktiv path. var myJobnr= (File($.fileName).parent.parent.parent.fullName); mFolder = Folder(myJobnr); mFolder = mFolder.selectDlg(); if(mFolder != null) { var myFiles = mFolder.getFiles('*.indd'); for (i = 0; i < myFiles.length; i++) { var myFile = myFiles[i]; destFile1= new File(MYmyFile.name);// to create an object myFiles[i].copy (destFile1); } } }
Thank you so much in advance sir