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

Export ai and PDF with setttings at the same time

Explorer ,
Jan 31, 2023 Jan 31, 2023

Copy link to clipboard

Copied

Hello. I recall seeing something like this a while ago but can't remember how it was implemented. What I'm trying to achieve is saving a document as an .ai file and a PDF file at the same time in 2 different locations. They would both share the same filename. For example the .ai file would save on the desktop and the PDF file would save in another folder with other PDFs. I would also need the PDF to save as "Smallest File Size" option.

 

Is there a feature, script or option that can accomplish this?

 

Thank you.

TOPICS
Import and export , Performance , Scripting

Views

734

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 2 Correct answers

Guide , Feb 01, 2023 Feb 01, 2023

This is a bare minimum script.  The first line contains the AI path, the second line the PDF path, the target for both being set to desktop.  You can change the path using the following syntax (for Windows):  "/C/Users/femkeblanco/Desktop/"

var file1 = new File("~/Desktop/"); 
var file2 = new File("~/Desktop/");
var PDF = new PDFSaveOptions;
PDF.pDFPreset = "[Smallest File Size]";
app.activeDocument.saveAs(file1);
app.activeDocument.saveAs(file2, PDF);

Votes

Translate

Translate
Guide , Feb 03, 2023 Feb 03, 2023
var name1 = prompt("Enter file name:", "");
var file1 = new File("~/Desktop/" + name1); 
var file2 = new File("~/Desktop/" + name1);
var PDF = new PDFSaveOptions;
PDF.pDFPreset = "[Smallest File Size]";
app.activeDocument.saveAs(file1);
app.activeDocument.saveAs(file2, PDF);

Votes

Translate

Translate
Adobe
Community Expert ,
Jan 31, 2023 Jan 31, 2023

Copy link to clipboard

Copied

That may have been an action, possibly run as a Batch process.

 

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
Explorer ,
Jan 31, 2023 Jan 31, 2023

Copy link to clipboard

Copied

Interesting. Do you know where I might find something like that?

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 ,
Jan 31, 2023 Jan 31, 2023

Copy link to clipboard

Copied

You may create your own action. It's pretty easy to record it in the Actions palette.

 

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
Adobe Employee ,
Jan 31, 2023 Jan 31, 2023

Copy link to clipboard

Copied

Hello @Bria5EB3,

 

Thanks for reaching out. I hope the suggestions shared by Kurt helped answer your queries. You may also want to try the suggestions shared in this community post (https://community.adobe.com/t5/illustrator-discussions/script-to-save-different-file-formats/td-p/90...) and check if it helps.

 

Looking forward to your response.

 

Thanks,

Anubhav

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
Guide ,
Feb 01, 2023 Feb 01, 2023

Copy link to clipboard

Copied

This is a bare minimum script.  The first line contains the AI path, the second line the PDF path, the target for both being set to desktop.  You can change the path using the following syntax (for Windows):  "/C/Users/femkeblanco/Desktop/"

var file1 = new File("~/Desktop/"); 
var file2 = new File("~/Desktop/");
var PDF = new PDFSaveOptions;
PDF.pDFPreset = "[Smallest File Size]";
app.activeDocument.saveAs(file1);
app.activeDocument.saveAs(file2, PDF);

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
Explorer ,
Feb 03, 2023 Feb 03, 2023

Copy link to clipboard

Copied

Thank you, this is what we were looking for. Thank you so much!

As an alternative - is there a line of code or so that could be added to this that could let you choose a filename when saving.? Same file name for both ai and PDF.

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
Guide ,
Feb 03, 2023 Feb 03, 2023

Copy link to clipboard

Copied

var name1 = prompt("Enter file name:", "");
var file1 = new File("~/Desktop/" + name1); 
var file2 = new File("~/Desktop/" + name1);
var PDF = new PDFSaveOptions;
PDF.pDFPreset = "[Smallest File Size]";
app.activeDocument.saveAs(file1);
app.activeDocument.saveAs(file2, PDF);

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
Explorer ,
Mar 07, 2023 Mar 07, 2023

Copy link to clipboard

Copied

Sorry to rehash this one but wondering if you knew the answer to this code:

When our artists are trying this - it all works as planned but it won't name the file. Lets say the document is called "untitled" when you run the script it will ask you what to name it. You can put the name in and hit OK and it'll save both files as intended in both paths as intended but the name will still be "untitled"

Any idea why?

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
Guide ,
Mar 08, 2023 Mar 08, 2023

Copy link to clipboard

Copied

LATEST

Do you mean the two new files (AI and PDF) will be named "untitled"?  (I presume you're using Latin alphabet with no unusual characters.) 

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