Batch Convert SVG to EPS in Illustrator (Free Script)
Free Adobe Illustrator script that converts a whole folder of SVG files to Illustrator 10 EPS, the format Shutterstock requires for vectors.
Download illustrator-batch-svg-to-eps.jsxJavaScript (ExtendScript) · 76 lines · 3 KB · free
Shutterstock and several other stock sites take vectors as EPS only. If your artwork is in SVG, opening and saving each file by hand takes minutes per file. This script converts a whole folder, including subfolders, while you do something else.
What it does
- Finds every
.svgin the folder you choose and in its subfolders - Saves each one as an Illustrator 10 compatible EPS in a folder named
EPSnext to the SVG files - Keeps the same file name, so your metadata spreadsheet still matches
- Changes nothing in the artwork and never modifies the original SVG
- Skips files that already have an EPS, so it is safe to run again
- Shows a summary at the end, including any file that failed
How to use it
- Run the script in Illustrator (see below).
- Choose the folder that holds your SVG files, or a parent folder.
- Wait for the summary message. The EPS files are in the new
EPSfolders.
How to run an Illustrator script
- Download the script with the button on this page.
- Open Adobe Illustrator. No document needs to be open.
- Go to File > Scripts > Other Script... (Ctrl+F12 on Windows, Cmd+F12 on Mac).
- Choose the downloaded
.jsxfile.
To keep the script in the menu, copy it into Illustrator's Presets > en_US > Scripts folder inside the Illustrator application folder and restart Illustrator. It then appears under File > Scripts.
Illustrator may warn that scripts can change your files. That is normal for any script. This one's full code is shown at the bottom of the page so you can read what it does.
Preparing files for Shutterstock
The script saves each file at the size it already has. Before converting, check that:
- the artboard is between 4 and 25 megapixels (width times height in pixels)
- all text is converted to outlines
- nothing important hangs outside the artboard
If your source files are .ai and need resizing to fit under 25 megapixels, use the AI to SVG and EPS script, which resizes automatically.
Questions
Why Illustrator 10 EPS?
Stock sites ask for older EPS versions because they open in almost any software. Shutterstock accepts EPS compatible with Illustrator 8 or 10.
Will transparency and gradients survive?
Illustrator 10 EPS supports gradients. Some newer effects, such as certain blends and transparency, are flattened when saved to this old format. Open one converted file and check it before uploading a batch.
Does it need a document open?
No. The script opens and closes each file itself.
The code
This is the complete script. Nothing else is downloaded or installed.
// illustrator-batch-svg-to-eps.jsx
// Free script from LinearAndLoom Icons: https://linearandloomicons.netlify.app/scripts/
// Provided as is. Try it on a copy of your files first.
/* SVG to EPS for Shutterstock - Adobe Illustrator script
------------------------------------------------------------
Shutterstock accepts vectors as EPS only (Illustrator 8 or 10 compatible, 4-25 MP).
This script saves at the size the SVG already has. Size your artboards under 25 MP first,
and convert text to outlines.
HOW TO RUN
Illustrator: File > Scripts > Other Script... > choose this file.
Pick the folder that contains your .svg files (or any parent folder).
WHAT IT DOES
- Finds every .svg in the chosen folder and its subfolders.
- Saves each one as an Illustrator 10 compatible EPS in a folder named "EPS" next to the SVG files,
with the same file name (so the CSV metadata matches).
- Opens and saves as-is: nothing in the artwork is changed. Original SVGs are never modified.
- Existing EPS files are skipped, so it is safe to run again.
*/
#target illustrator
(function () {
var root = Folder.selectDialog("Select the folder with the SVG files");
if (!root) { return; }
var previousLevel = app.userInteractionLevel;
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
var converted = 0, skipped = 0, failed = [];
function epsOptions() {
var o = new EPSSaveOptions();
o.compatibility = Compatibility.ILLUSTRATOR10;
o.preview = EPSPreview.COLORTIFF;
o.embedAllFonts = true;
o.embedLinkedFiles = true;
o.includeDocumentThumbnails = true;
o.cmykPostScript = false;
o.postScript = EPSPostScriptLevelEnum.LEVEL2;
return o;
}
function walk(folder) {
var items = folder.getFiles(), svgs = [], i;
for (i = 0; i < items.length; i++) {
var it = items[i];
if (it instanceof Folder) {
var n = it.name.toLowerCase();
if (n !== "eps" && n !== "illustrator" && n !== "__macosx" && n.charAt(0) !== ".") { walk(it); }
} else if (/\.svg$/i.test(it.name) && it.name.charAt(0) !== ".") { svgs.push(it); }
}
if (!svgs.length) { return; }
var out = new Folder(folder.fsName + "/EPS");
if (!out.exists) { out.create(); }
for (i = 0; i < svgs.length; i++) {
var target = new File(out.fsName + "/" + decodeURI(svgs[i].name).replace(/\.svg$/i, ".eps"));
if (target.exists) { skipped++; continue; }
var doc = null;
try {
doc = app.open(svgs[i]);
doc.saveAs(target, epsOptions());
doc.close(SaveOptions.DONOTSAVECHANGES);
converted++;
} catch (e) {
failed.push(decodeURI(svgs[i].name) + " (" + e + ")");
try { if (doc) { doc.close(SaveOptions.DONOTSAVECHANGES); } } catch (e2) {}
}
}
}
try { walk(root); } finally { app.userInteractionLevel = previousLevel; }
var msg = "SVG to EPS - finished\n\nConverted: " + converted + "\nAlready existed (skipped): " + skipped + "\n";
if (failed.length) { msg += "\nCould not convert " + failed.length + ":\n" + failed.slice(0, 15).join("\n"); }
alert(msg);
})();
Download illustrator-batch-svg-to-eps.jsxJavaScript (ExtendScript) · 76 lines · 3 KB · free
These scripts are free. If one saved you time, you can say thanks by buying a pack from the LinearAndLoom Etsy shop.


