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.
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);
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);
Copy link to clipboard
Copied
That may have been an action, possibly run as a Batch process.
Copy link to clipboard
Copied
Interesting. Do you know where I might find something like that?
Copy link to clipboard
Copied
You may create your own action. It's pretty easy to record it in the Actions palette.
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
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);
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.
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);
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?
Copy link to clipboard
Copied
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.)