Answer the question
In order to leave comments, you need to log in
How do I convert hundreds of .SVGs to .AI without going crazy?
I am not familiar with vector graphics (so far). There is a bank of SVG images from the client. It needs to be converted to .AI so that After Effects can eat them.
How to do this by clicking several times, not a thousand?
I tried the converters that search engines offer - convertio distorts images, and from the rest (free) you need to download one at a time.
Answer the question
In order to leave comments, you need to log in
The script can
// file: convert_svg_to_ai.jsx
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
var inputDir = Folder.selectDialog("Input Dir?");
var outputDir = Folder.selectDialog("Output Dir?");
var files = inputDir.getFiles('*.svg');
var saveOpts = new IllustratorSaveOptions();
saveOpts.compressed = true;
saveOpts.embedICCProfile = true;
saveOpts.embedLinkedFiles = true;
saveOpts.pdfCompatible = true;
for (var f = 0; f < files.length; f++){
var doc = app.open(files[f]);
var newFile = new File(outputDir + '/' + doc.name);
doc.saveAs(newFile, saveOpts);
doc.close(SaveOptions.DONOTSAVECHANGES);
}
app.userInteractionLevel = UserInteractionLevel.DISPLAYALERTS;
convert_svg_to_ai.jsx
, in illustrator choose file->scripts->other script and choose convert_svg_to_ai.jsx. In the first dialog box, you specify the folder where the svg files are located, in the second - where to save the .ai
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question