MacOS – Batch resize .svg files

automationautomatormacos

I have a folder (original_svg_files) with more than ten thousand .svg files in different sizes and I need to resize each one of them. The name should be the same with the original .svg file and the longest side should be 150px and I also need to keep the aspect ratio (constrain the proportions).

I tried to use Adobe Illustrator to do that but can't figure out how since it supports only transformation via a percentage. I need to automate this process by the command line or Automator since what I am doing now is really time consuming!

I am using OS X El Capitan version 10.11.1.

Any suggestions?

Best Answer

Looks like the -fit option on this command line utility will do exactly what you want:

https://github.com/vieron/svg-resizer

If you need help with brew, look here: http://coolestguidesontheplanet.com/installing-homebrew-os-x-yosemite-10-10-package-manager-unix-apps/

If your not comfortable with the command line, don't let it intimidate you - it's really not that hard. Post back if you get stuck or something just doesn't make sense.