Skip to main content
Known Participant
May 1, 2008
Question

filepath to a shared drive

  • May 1, 2008
  • 3 replies
  • 395 views
I'm trying a script that adds a "j_" to the beginning and an"_a" to the end if the file name and then saves a pdf to the hardcoded directory on a share. I can't seem to get the path to the directory correct. Here is the directory path I wish to save to:
/Volumes/Common/FastChannel/watchedfolders/ZwebPDFs/j_VACJ-0960_a.pdf

and here's the script:
try {
with ( app.activeDocument ) {
// Export the pdfs to the ZWEB with correct naming conventions
myPDFFile = new File( filePath + "/Common/FastChannel/watchedfolders/ZwebPDFs/" + "j_" + app.activeDocument.name.split(".indd")[0] + "_a" + ".pdf" );
exportFile( ExportFormat.pdfType, myPDFFile, false, "[Smallest File Size]" );

}
}

Does anyone know how to hard code a path to a share?

Thanks,
Randy
This topic has been closed for replies.

3 replies

May 2, 2008
Try just making your PDF file variable as a string var instead and feeding that to export instead, perhaps?

I work in Applescript, but I know it gets balky when I try and create an alias to a file that doesn't exist. Also, the export command says it can accept a string or alias in AS. Hopefully JS is the same.
Known Participant
May 2, 2008
I realized that I had filePath in the beginning of the path which would set the start point at my existing file, Doh!

So I tried changing the save line to the following:
myPDFFile = new File("/Volumes/Common/FastChannel/watchedfolders/ZwebPDFs/" + "j_" + app.activeDocument.name.split(".indd")[0] + "_a" + ".pdf" );

to no avail.

In Adobe's scripting manual it says this should work.

Anybody?
Known Participant
May 1, 2008
BTW,
I do know how to traverse folders with a relative path starting point. I still can't find how to do an absolute path.