Copy link to clipboard
Copied
I am looking for a script or instructions for a script with which I can directly control or select a specific PDF setting (I would give the script a keyboard command). Unfortunately my scripting skills are extremely limited...
The script should really only call up the job option mentioned, that's all it needs to be able to do.
By @sanders001
Try this:
var myPDFExportPreset = app.pdfExportPresets.item("ml_PDF_Translation_Black");
var myFolder = Folder.selectDialog ('Choose a Folder');
var pdf = String (app.activeDocument.fullName).replace (/\.indd$/, ".pdf");
pdf = pdf.replace(app.activeDocument.filePath,"");
app.activeDocument.exportFile(ExportFormat.pdfType, File(myFolder + pdf), false, myPDFExportPreset);
Copy link to clipboard
Copied
Should be easy enough
Do you want the same file name - do you need a prompt for the file name?
Do you want it to save to the same folder as the InDesign file or a different folder?
Do you have PDF preset saved - and what is the name of your PDF preset so it can be selected when running the script?
Any other info you can give for this?
Copy link to clipboard
Copied
That sounds very promising!
To your questions:
1. Yes, the PDF should have the same file name as the InDesign file
2. The PDFs are stored in a different folder - but I can easily select the folder using a shortcut with DefaultFolder.
3. i have a preset for the PDF output: ml_PDF_Translation_Black
That’s it!
Thanks in advance for you efforts!
Matthias
Copy link to clipboard
Copied
If you work on a PC - you can use free version of my tool:
You can ignore bottom part of the screen.
Copy link to clipboard
Copied
Tanks for your answer – unfortunately, I am a Mac user, and you tool is a exe file, isn’t it?
Copy link to clipboard
Copied
Tanks for your answer – unfortunately, I am a Mac user, and you tool is a exe file, isn’t it?
By @sanders001
Yeah, it's an EXE so PC only.
Copy link to clipboard
Copied
The script should really only call up the job option mentioned, that's all it needs to be able to do.
Copy link to clipboard
Copied
The script should really only call up the job option mentioned, that's all it needs to be able to do.
By @sanders001
Try this:
var myPDFExportPreset = app.pdfExportPresets.item("ml_PDF_Translation_Black");
var myFolder = Folder.selectDialog ('Choose a Folder');
var pdf = String (app.activeDocument.fullName).replace (/\.indd$/, ".pdf");
pdf = pdf.replace(app.activeDocument.filePath,"");
app.activeDocument.exportFile(ExportFormat.pdfType, File(myFolder + pdf), false, myPDFExportPreset);
Copy link to clipboard
Copied
Great, it works!
But: I'm wondering how to get the first dialog window to appear after choosing a folder – because sometimes I just need to output one of two pages as a PDF. To do this I have to enter into the first dialogue window.
Copy link to clipboard
Copied
Great, it works!
But: I'm wondering how to get the first dialog window to appear after choosing a folder – because sometimes I just need to output one of two pages as a PDF. To do this I have to enter into the first dialogue window.
By @sanders001
Change "false" to "true" in the last line - it will show PDF Export dialog.
Copy link to clipboard
Copied
Absolutely great! That’s it! Thank you so much indeed, this really helps me a lot!
Matthias
Copy link to clipboard
Copied
Absolutely great! That’s it! Thank you so much indeed, this really helps me a lot!
Matthias
By @sanders001
You are welcome.
Copy link to clipboard
Copied