Save this file as ai2svg
, make it executable via chmod +x ai2svg
then run it optionally passing the folder to look for.
It will convert in that folder, or the current one, all .ai files into .svg
#!/usr/bin/bash
createsvg() {
local margin="$1"
local d
local svg
for d in *.ai; do
svg=$(echo "$d" | sed 's/.ai/.svg/')
echo "creating $svg ..."
# old version: inkscape "$d" -l -o "$svg"
if [ "$margin" != "" ]; then
inkscape "$d" --export-area-drawing --export-margin $margin "--export-plain-svg=$svg"
else
inkscape "$d" --export-area-drawing "--export-plain-svg=$svg"
fi
done
}
if [ "$1" != "" ];then
cd $1
fi
createsvg "$2"
./ai2svg ./folder/path
You need a command line on Linux, it might work on macOS too, if you have Inkscape, but if you’re windows’ user please look at any further result in Google or try with WSL