Reply To: Save Indesign File with Specific Name in Specific Location – JS

#81041
Marcin Ploch
Member

Thank You Peter for the answer.
Your code works nearly perfect for for my need.
But there is one more thing ….

I want Indesign to write a file to a Folder which I’ve chosen during opening a xxxxx.INDT
Indesign KNOWS the path because alert from this line returns the right value of var SysFolder which is probably a string:

var SysFolder = Folder.selectDialog(); alert(SysFolder)

also I’ve made such variables:

var PlikiIndt = SysFolder.getFiles(“*.indt”); //alert(PlikiIndt[0].name);
var PlikiXML = SysFolder.getFiles(“*.xml”); //alert(PlikiXML[0].name);

to save a file name I made another variable:

var SaveName = “000_” + PlikiXML[0].name.slice(19,-24) + “_” + PlikiXML[0].name.slice(4,15) + “.indd”; alert(SaveName);
doc.save (File(“/Users/marcinploch/Desktop/TEST” + SaveName));

finaly indesign writes proper file name but in folder described by given string.

The question is how to use path from SysFolder variable ??

Regards
Marcin

This article was last modified on January 23, 2016

Comments (0)

Loading comments...