Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help to set activepath on my function

Explorer ,
Jul 18, 2014 Jul 18, 2014

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

TOPICS
Scripting
318
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jul 18, 2014 Jul 18, 2014

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:

active path and function

If mFolder is some place you want to start a dialog tree-view - mFolder.openDlg() works in the same way.

Jarek

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 18, 2014 Jul 18, 2014

I dont get it at all,

Could you implemente that in the code?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jul 18, 2014 Jul 18, 2014

Right,

function copyfiles()

    {

    var _files = new File("C:/test/xxx example").openDlg("Select indesign files","*.indd",true);

    // ...

    }

Jarek

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 18, 2014 Jul 18, 2014
LATEST

Awesome Thanks again Jarek,

I really appreciate this thanks sir.

have a nice weekend soon

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines