-
1. Re: [CS3] [JS] Export PDF to the same folder as the InDesign file
Harihara Sudhan Aug 25, 2009 9:46 PM (in response to MichaelN)Dear MN1958,
I read your msg,
Here get the File path and pass this path in to Export PDF time.
Here the below Script
//========================== Export PDF ================================//
var myDoc = app.activeDocument;
var myDocName = myDoc.name;
var myFolder = myDoc.filePath;
var myBaseName=myDocName.split(".indd")[0];
var t1 = String(myFolder);
var t2= t1.split("/");
for(var i=0; i<t2.length-1; i++)
{
Final = Final+t2[i]+"/";
}var ExPDFs= File(Final+myBaseName + ".pdf");
pdfPreset = app.pdfExportPresets.item("Sample");
myDoc.exportFile(ExportFormat.pdfType, ExPDFs, false, pdfPreset);myDoc.close(SaveOptions.NO);
//========================== End - Export PDF Script ================================//
Please use the above script and enjoy....
Thanks & Regards
T.R.Harihara SudhaN
-
2. Re: [CS3] [JS] Export PDF to the same folder as the InDesign file
MichaelN Aug 25, 2009 10:41 PM (in response to Harihara Sudhan)Thanks for your suggestion, but it did not work.
After tinkering with the script, I came up with a simple solution that does the job:
var myDoc = app.activeDocument;
var myFolderName = myDoc.filePath;
//Apply a name to the PDF file based on the INDD file, but without the .indd extension
var myDocumentName = myDoc.name.slice (0, -5);
var myFilePath = myFolderName + "/" + myDocumentName + ".pdf";
var myFile = new File(myFilePath);
//Do not open the PDF Export dialog box. Set "false" to "true" if you want the dialog box.
myDoc.exportFile(ExportFormat.pdfType, myFile, false, "Press Quality");
-
3. Re: [CS3] [JS] Export PDF to the same folder as the InDesign file
Harihara Sudhan Aug 25, 2009 11:30 PM (in response to MichaelN)Hi
Please another another one time check it out..
//Do not open the PDF Export dialog box. Set "false" to "true" if you want the dialog box.
myDoc.exportFile(ExportFormat.pdfType, myFile, false, "Press Quality");
Instead I used
var ExPDFs= File(Final+myBaseName + ".pdf");
pdfPreset = app.pdfExportPresets.item("Sample");myDoc.exportFile(ExportFormat.pdfType, ExPDFs, false, pdfPreset);
Here I think u made mistake in "pdfPreset " passing argument...
I used Sample -> PDF Preset name, but u passing PDF Preset is directly [Press Quality]... thats all.
Then how come u say this script is not working....like that?.
I used this script in my Projects U know?.
Please try to reveal and check throughly after that U say the word "Thanks for your suggestion, but it did not work."
"......"
OK.
-
4. Re: [CS3] [JS] Export PDF to the same folder as the InDesign file
Thomas B. Nielsen Aug 26, 2009 12:45 AM (in response to MichaelN)This is the script that i use, let me know if you would like the .jsx version so you can edit it.
UI might be in danish, don't remember.
http://www.nobrainer.dk/eksporter-pdf-ved-indesign/
--
Thomas B. Nielsen
-
5. Re: [CS3] [JS] Export PDF to the same folder as the InDesign file
Peter Kahrel Aug 26, 2009 1:10 AM (in response to MichaelN)This line:
pdf = File (String (app.documents[0].fullName).replace (/\.indd$/, ".pdf"));
returns a file object you can export to. Its name is the full path name of the active document with the .indd extension replaced with .pdf.
Peter
-
6. Re: [CS3] [JS] Export PDF to the same folder as the InDesign file
MichaelN Aug 26, 2009 4:42 PM (in response to MichaelN)Thank you to all for your help.
The script now works great!


