*Update – We just launched The Side Project Accelerator, an 8-week online program to share everything we learned while building and growing Hacking UI. We’re looking for people who want to improve their personal branding, become thought leaders and launch side projects. Applications are open until July 25th. Check it out →
Finally a solution to one of the biggest and most annoying workflow setbacks in every interaction designer’s day. Here’s a free script that we created that will save you a lot of time slicing and restore your sanity.
What this Photoshop script does:
This script, once activated, exports all vector layers named with “.svg” at the end of the layer name as SVG files, along with their shape and color attribute.
No more slicing SVGs one by one like a caveman. Finished preparing your layers? Boom!
- Windows or Mac OSX
- Photoshop CS5, CS6
- Adobe Illustrator
How to use this script:
- Download following instructions below.
- Drag this to your adobe photoshop scripts folder: “Adobe Photoshop/presets/scripts”
- (OPTIONAL) Go to photoshop and set a keyboard shortcut to use this script (can be done through “Edit” menu –> Keyboard Shortcuts” and then in File –> Scripts –> PS to SVG). We like to use CMD+ALT+E, but you can set whatever keyboard shortcut you wish.
- In your PSD name the vector layers you would like to export with a “.svg” at the end. For instance a layer named “Star” should be named “Star.svg”.
- When ready – simply activate the script by the keyboard shortcut you defined in step 3, or by the menu in: File –> Scripts –> PS to SVG, and your files will be waiting for you in the same directory as your PSD.
Tip: Works faster if Illustrator is already open before activating the script.
- The script is not compatible with the new versions of Photoshop CC, which by the way has an “export assets” feature.
- The script also creates AI files in addition to the SVG files. You can delete those, you don’t need to use them.
- This script only works on vector layers, and not on groups of layers.
Read all about how we use the script in our own workflow
Sagi shared his workflow in exporting SVGs out of Photoshop when working on a large design project.
Download the script:
Script not working! What now?
- Check that you put the “.svg” (DOT SVG) at the end of the names of the layers you wish to export, and that each of those layers is a single vector layer.
- Check that your illustrator is working.
- Check that the vector layers you want to export are closed vectors. Sometimes shapes can appear closed, but there are actually 2 overlapping points that have not been joined and therefore it is not really defined as a “shape” yet by photoshop.
More UX & Frontend goodness
- The goat herding, algorithm cracking, autodidact Tal Perry (Citi, Smart Scribe) - September 21, 2016
- Jason & Brian (Good Fucking Design Advice) on abandoning fear and getting out of your comfort zone - September 15, 2016
- Bob Baxley (former Apple, Yahoo, Pinterest) on creating powerful design leadership - July 20, 2016
- How we built a large blog using WordPress, Heroku and Git: under the hood of Hacking UI - July 4, 2016
- The Side Project Accelerator - June 27, 2016
- Introducing: The Design Conferences Slack Team - March 3, 2016
- Scaling a Design Team, Episode #3: Feat. Melissa Hajj, Design Manager at Facebook - January 29, 2016
- Free SEO and Data Icon Set - April 7, 2015
- A 5-minute trick to start tracking events in Google Analytics or Mixpanel - March 10, 2015
- The Chrome CSS Bug That Crashed Our Site - January 4, 2015