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

Looking for a script for PDF creation

Community Beginner ,
Mar 07, 2024 Mar 07, 2024

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...

TOPICS
Scripting

Views

302

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Mar 07, 2024 Mar 07, 2024
quote

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);

 

 

Votes

Translate

Translate
Community Expert ,
Mar 07, 2024 Mar 07, 2024

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?

Votes

Translate

Translate

Report

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
Community Beginner ,
Mar 07, 2024 Mar 07, 2024

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

Votes

Translate

Translate

Report

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
Community Expert ,
Mar 07, 2024 Mar 07, 2024

Copy link to clipboard

Copied

@sanders001 

 

If you work on a PC - you can use free version of my tool:

 

RobertTkaczyk_0-1709821041303.png

 

You can ignore bottom part of the screen.

 

Votes

Translate

Translate

Report

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
Community Beginner ,
Mar 07, 2024 Mar 07, 2024

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?

Votes

Translate

Translate

Report

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
Community Expert ,
Mar 07, 2024 Mar 07, 2024

Copy link to clipboard

Copied

quote

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.

 

Votes

Translate

Translate

Report

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
Community Beginner ,
Mar 07, 2024 Mar 07, 2024

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.

Votes

Translate

Translate

Report

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
Community Expert ,
Mar 07, 2024 Mar 07, 2024

Copy link to clipboard

Copied

quote

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);

 

 

Votes

Translate

Translate

Report

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
Community Beginner ,
Mar 07, 2024 Mar 07, 2024

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.

Votes

Translate

Translate

Report

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
Community Expert ,
Mar 07, 2024 Mar 07, 2024

Copy link to clipboard

Copied

quote

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. 

 

Votes

Translate

Translate

Report

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
Community Beginner ,
Mar 07, 2024 Mar 07, 2024

Copy link to clipboard

Copied

Absolutely great! That’s it! Thank you so much indeed, this really helps me a lot!

Matthias

Votes

Translate

Translate

Report

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
Community Expert ,
Mar 07, 2024 Mar 07, 2024

Copy link to clipboard

Copied

LATEST
quote

Absolutely great! That’s it! Thank you so much indeed, this really helps me a lot!

Matthias


By @sanders001

 

You are welcome.

 

Votes

Translate

Translate

Report

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
Community Expert ,
Mar 07, 2024 Mar 07, 2024

Copy link to clipboard

Copied

@sanders001 

 

Can you be more specific with your requirements?

 

Votes

Translate

Translate

Report

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