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

Batch export AI file into PDFs with adobe PDF presets and adding suffix

Community Beginner ,
Dec 17, 2021 Dec 17, 2021

Copy link to clipboard

Copied

Hi all,

I was wondering if someone could please help me and see if this is possible.  I have limited knowledge of scripts and need some help.  I have to export several Ai files to pdf daily at my work, and save as a "LowRes" Adobe PDF preset, and add "_LowRes" to the pdf name. Then export again with "HiRes" Adobe PDF preset (mostly adding trim marks/bleed), and add "_HiRes" to the pdf name. Right now, its all manual work to do that for each AI files.

 

Is it possible with a script to do this: 

1. Select a folder/ grab XX of these AI files. 
2. Export 2 versions of each file 
  • A. With “XX” PDF preset settings and add “_LowRes” to file name
  • B. With “XX” PDF preset settings and add “_HiRes” to file name 

 

Any help would be greatly appreciated, Thanks in advance!
TOPICS
How to , Import and export , Scripting

Views

212

Likes

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

Advisor , Dec 17, 2021 Dec 17, 2021

I don't have "LowRes" and "HiRes" PDF presets, so I've used "High Quality Print" and "Smallest File Size". 

 

var files = File.openDialog("Select files", "*.ai", true);
for (var i = 0; i < files.length; i++) {
    app.open(files[i]);
    var file1 = new File(String(files[i].fullName).slice(0, -3) + "_HiRes.pdf");
    var file2 = new File(String(files[i].fullName).slice(0, -3) + "_LowRes.pdf");
    var PDF1 = new PDFSaveOptions();
    var PDF2 = new PDFSaveOptions();
    PDF1.pDFPreset = "[High Qua
...

Likes

Translate

Translate
Community Expert ,
Dec 17, 2021 Dec 17, 2021

Copy link to clipboard

Copied

Which version of Illustrator are you using?

 

Likes

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 ,
Dec 17, 2021 Dec 17, 2021

Copy link to clipboard

Copied

Hi Kurt, 

 

I'm using Illustrator 2022 CC. 

Likes

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
Advisor ,
Dec 17, 2021 Dec 17, 2021

Copy link to clipboard

Copied

I don't have "LowRes" and "HiRes" PDF presets, so I've used "High Quality Print" and "Smallest File Size". 

 

var files = File.openDialog("Select files", "*.ai", true);
for (var i = 0; i < files.length; i++) {
    app.open(files[i]);
    var file1 = new File(String(files[i].fullName).slice(0, -3) + "_HiRes.pdf");
    var file2 = new File(String(files[i].fullName).slice(0, -3) + "_LowRes.pdf");
    var PDF1 = new PDFSaveOptions();
    var PDF2 = new PDFSaveOptions();
    PDF1.pDFPreset = "[High Quality Print]";
    PDF2.pDFPreset = "[Smallest File Size]";
    app.activeDocument.saveAs(file1, PDF1);
    app.activeDocument.saveAs(file2, PDF2);
    app.activeDocument.close();
}

Likes

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 ,
Dec 17, 2021 Dec 17, 2021

Copy link to clipboard

Copied

Thank you so much!! This worked like a charm:) I was able to swap out the naming of the presets. You made my day! 

 

Likes

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
New Here ,
Aug 15, 2022 Aug 15, 2022

Copy link to clipboard

Copied

Dear all, thank you for this script.
Can someone explain to me how I can add the action "select all > change to lettercontour"?

Thank you! Linda

Likes

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 ,
Aug 15, 2022 Aug 15, 2022

Copy link to clipboard

Copied

LATEST

var frames = app.activeDocument.textFrames;

for(var f=0;f<frames.length;f++)

{

    frames[f].createOutline();

}

Likes

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