Page 1 of 1

Save as older Illustrator EPS

Posted: Mon Mar 02, 2020 8:05 am
by Terkelsen
I'm looking for a script that can save a PDF as an Illustrator EPS but in an older Illustrator version than the one installed. Anyone?

Re: Save as older Illustrator EPS

Posted: Mon Mar 02, 2020 8:19 am
by jan_suhr
Try this in Switch as a Save As Script for Illustrator, it will save it as AI8 but that can easily be changed to something else..

Code: Select all

// Save as Ai 8
var dest = $outfolder + "/" + $filename + ".ai";
var originalInteractionLevel = userInteractionLevel;
var saveName = new File ( dest );

userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;

saveOpts = new IllustratorSaveOptions();
saveOpts.compatibility = Compatibility.ILLUSTRATOR8; 
saveOpts.generateThumbnails = true; 
saveOpts.preserveEditability = true;
$doc.saveAs( saveName, saveOpts );
$outfiles = [dest];

Or save it as an EPS from Ai8

Code: Select all

// Save as Ai8 EPS
var dest = $outfolder + "/" + $filename + ".eps";
var originalInteractionLevel = userInteractionLevel;
var saveName = new File ( dest );

userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;

saveOpts = new EPSSaveOptions();
saveOpts.compatibility = Compatibility.ILLUSTRATOR8; 
saveOpts.generateThumbnails = true; 
saveOpts.preserveEditability = true;
$doc.saveAs( saveName, saveOpts );
$outfiles = [dest];
Or for Ai CS6

Code: Select all

// Save as Ai 8
var dest = $outfolder + "/" + $filename + ".ai";
var originalInteractionLevel = userInteractionLevel;
var saveName = new File ( dest );

userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;

saveOpts = new IllustratorSaveOptions();
saveOpts.compatibility = Compatibility.ILLUSTRATOR16; 
saveOpts.generateThumbnails = true; 
saveOpts.preserveEditability = true;
$doc.saveAs( saveName, saveOpts );
$outfiles = [dest];


Re: Save as older Illustrator EPS

Posted: Mon Mar 02, 2020 9:18 am
by Terkelsen
Thanks a lot, Jan. This seems to work perfect for all versions prior to 17 (the first CC version). Do you also know how to change it to work with the CC-versions?

Re: Save as older Illustrator EPS

Posted: Mon Mar 02, 2020 9:30 am
by jan_suhr
Just change "ILLUSTRATOR16" to a later version number I think the latest is 19

Re: Save as older Illustrator EPS

Posted: Mon Mar 02, 2020 12:08 pm
by Terkelsen
That's how I thought it would work, but if I change Compatibility.ILLUSTRATOR16 to Compatibility.ILLUSTRATOR19, Switch will give this error:

Error 1320: Invalid enumeration value
Line: 40
-> saveOpts.compatibility = Compatibility.ILLUSTRATOR19; (5001)

Re: Save as older Illustrator EPS

Posted: Mon Mar 02, 2020 1:01 pm
by jan_suhr
Maybe there is something with the Configurator.

According to documentation it should work with Compatibility.ILLUSTRATOR19

I can only get it to work up to Compatibility.ILLUSTRATOR16 with my Switch 2019 Fall and Illustrator 2020

https://illustrator-scripting-guide.rea ... patibility

Adobes latest Scripting documentation is for 2017.

Check with Enfocus Support

Re: Save as older Illustrator EPS

Posted: Wed May 17, 2023 8:23 pm
by Mihail_Vereten
Thank you so much! Great script
jan_suhr wrote: Mon Mar 02, 2020 8:19 am Try this in Switch as a Save As Script for Illustrator, it will save it as AI8 but that can easily be changed to something else..

Code: Select all

// Save as Ai 8
var dest = $outfolder + "/" + $filename + ".ai";
var originalInteractionLevel = userInteractionLevel;
var saveName = new File ( dest );

userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;

saveOpts = new IllustratorSaveOptions();
saveOpts.compatibility = Compatibility.ILLUSTRATOR8; 
saveOpts.generateThumbnails = true; 
saveOpts.preserveEditability = true;
$doc.saveAs( saveName, saveOpts );
$outfiles = [dest];

Or save it as an EPS from Ai8

Code: Select all

// Save as Ai8 EPS
var dest = $outfolder + "/" + $filename + ".eps";
var originalInteractionLevel = userInteractionLevel;
var saveName = new File ( dest );

userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;

saveOpts = new EPSSaveOptions();
saveOpts.compatibility = Compatibility.ILLUSTRATOR8; 
saveOpts.generateThumbnails = true; 
saveOpts.preserveEditability = true;
$doc.saveAs( saveName, saveOpts );
$outfiles = [dest];
Or for Ai CS6

Code: Select all

// Save as Ai 8
var dest = $outfolder + "/" + $filename + ".ai";
var originalInteractionLevel = userInteractionLevel;
var saveName = new File ( dest );

userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;

saveOpts = new IllustratorSaveOptions();
saveOpts.compatibility = Compatibility.ILLUSTRATOR16; 
saveOpts.generateThumbnails = true; 
saveOpts.preserveEditability = true;
$doc.saveAs( saveName, saveOpts );
$outfiles = [dest];