Skip to main content
Participant
March 13, 2022
Question

Script to save lowres and hires

  • March 13, 2022
  • 2 replies
  • 421 views

Hello,

 

i am looking for a script that saves a lowres and hires version of my artwork.

I look the forums but to no avail.

 

Im working with version illustrator 26.1

Thanks in advance!

This topic has been closed for replies.

2 replies

Dave Creamer of IDEAS
Community Expert
Community Expert
March 13, 2022

Can't the Export for Screens do this?

David Creamer: Community Expert (ACI and ACE 1995-2023)
Legend
March 13, 2022

Hello @Andersom2,

 

You're not very specific on what you mean by "i am looking for a script that saves a lowres and hires version of my artwork."......lowres and hires what?? and what are you referring to when you say "artwork"?

The below script will export lowres and hires pdfs of the opened AI file...I hope this suits your needs.

var main = function() {
var doc = app.documents[0];
var myFile = doc.fullName;
var myFolder = doc.path;
fileName = doc.name.replace(/\.ai|\.eps/gi, "");

{
var pdfExport = new PDFSaveOptions();  
pdfExport.pDFPreset = '[Smallest File Size]'; 
app.activeDocument.saveAs(File(myFolder + "/" + fileName + "_LR.pdf"), pdfExport);
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
app.open(myFile);
}
{
var pdfExport = new PDFSaveOptions();  
pdfExport.pDFPreset = '[High Quality Print]'; 
app.activeDocument.saveAs(File(myFolder + "/" + fileName + "_HR.pdf"), pdfExport);  
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
app.open(myFile);
}
}
main();

 

Regards,

Mike

Participating Frequently
March 14, 2022

Hello @Mike Bro,

Do you know how to replace an existing pdf file with the same name (including the _LR) when using the script?

Thank you so much

Charu Rajput
Community Expert
Community Expert
March 15, 2022

Hi @Reiby 

Could you please add clear specifications?

Best regards