I have a folder that contains thousands of .ai files and I want to batch convert them to .svg files using Mac terminal.
Until now I did it through Adobe Illustrator but it takes days to batch convert .ai to .svg.
Is there any way to do it through the Terminal?
P.S. Keep in mind I am not a software developer but a regular user, so please explain as simple as possible with details, otherwise I will get lost and I will need further instructions :)
Thanks
Inkscape has some great command line tools for this. Check out their wiki page on this.
Their python script ai2svg.py looks like it should do the trick. Try the following command:
find . -name "filename*" -exec python ai2svg.py '{}' \;
Replace filename* with the matching filename(s) that you want to work on. To learn more about executing commands on multiple files see this post.
Hope this helps!
The ai2svg.py script suggested by Mikel hangs for me, but it seems Inkscape can be invoked from Terminal directly and does the job well:
Save the following script as a file ai2svg
, make it executable via chmod +x ai2svg
then run it, optionally passing the folder to look for Illustrator files.
It will convert in that folder, or the current one, all .ai files into .svg
#!/usr/bin/bash
createsvg() {
local d
local svg
for d in *.ai; do
svg=$(echo "$d" | sed 's/.ai/.svg/')
echo "creating $svg ..."
inkscape -f "$d" -l "$svg"
done
}
if [ "$1" != "" ];then
cd $1
fi
createsvg
source: https://gist.github.com/WebReflection/b5ab5f1eca311b76835c
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With