Copy link to clipboard
Copied
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.copy(new File(TargetFolder+ _parent + "/" + _files.name));
filenames +=_files.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
Copy link to clipboard
Copied
Hi,
Cause we are on the scripting forum let me comment this a little...
Well, sometimes the only thing you can say is the one Pi Patel said to the tiger in the middle of the ocean - BE PATIENT!
Predefined paths was a subject of your last posts:
If mFolder is some place you want to start a dialog tree-view - mFolder.openDlg() works in the same way.
Jarek
Copy link to clipboard
Copied
I dont get it at all,
Could you implemente that in the code?
Copy link to clipboard
Copied
Right,
function copyfiles()
{
var _files = new File("C:/test/xxx example").openDlg("Select indesign files","*.indd",true);
// ...
}
Jarek
Copy link to clipboard
Copied
Awesome Thanks again Jarek,
I really appreciate this thanks sir.
have a nice weekend soon
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more