Export Illustrator Layers to SVG files

I’m currently working on an Adobe Edge job, it’s almost totally vector based, and it turned out there were few quick options for breaking Illustrator files down into multiple SVG files.

After looking around, I decided to add features to Matthew Ericson’s awesome exporter script. Adding the SVG export format was easy enough, unfortunately I ran into another problem.

The original tool was built for raster outputs, and whilst it did support EPS, each EPS file that was generated actually had all layers included (all invisible except one).
So after some reworking I got it to generate small vector SVG/EPS files, each containing only what was needed.

I also made it easier/cleaner to add new formats and added a few usability tweaks (options which don’t apply to the current output format are disabled).

Installation & Usage

Just drop this javascript file in your Illustrator scripts folder (CS6 is something like: C:\Program Files\Adobe\Adobe Illustrator CS6\Presets\en_GB\Scripts).

In Illustrator, use the File > Scripts > MultiExporter option to bring up the dialogue box, it’s all fairly self explanatory.

MultiExporterScreen

Notes

I made minimal changes to Matt’s functionality, here are his original notes with my modifications.

  • Supported formats are: PNG8, PNG24, PDF, EPS & SVG
  • You can choose whether you want to export all the artboards in the document with the currently visible layers showing, or if you want to export files for each of the layers in a document on the currently active artboard, or if you want to export a combination of all the artboards multiplied by all the layers.
  • Files are named based on their layer name. It only exports layers where their name has been changed from the default “Layer 1″, “Layer 2″ or “Artboard 1″, “Artboard 2″, etc. I removed this feature, but might add it back as a configurable option.
  • If you put a minus sign (-) in front of a layer name or artboard name, it will skip that layer or artboard. (Useful for when you no longer decide you like a particular mockup, but don’t want to delete it from the master Illustrator document.)
  • For layers only: If you put a plus sign (+) in front of a layer name, that layer will always be visible. Useful for if you want to have a layer that always appears in the background of each exported image.

It stores its settings in a nonvisible, nonprinting layer named “nyt_exporter_info”

  • It has an option for transparency.
  • It has an option for embedding linked imagery (EPS & SVG only).
  • It has an option for embedding fonts (EPS only).

Check out the Gist

If the panel is unusably small

This is most likely the result of an Illustrator bug affecting Dual monitor setups.
Open the script in a text editor and replace the following line:

this.dlg = new Window('dialog', 'Multi Exporter');

with the line:

this.dlg = new Window('dialog', 'Multi Exporter', undefined, {resizeable:true});

This will make the panel resizable.
(Thanks to Alexey Tcherniak for looking into this)

Edits 11/04/2013 – 8/05/2013

There were some issues with the alignment of objects when multiple artboards existed, which I’ve fixed.
Also, it now avoids outputting imagery when nothing would be included, this makes the “Artboard + Layers” output much more useful (as you’d rarely have one layer which spans across multiple artboards).
I have added the functionality to trim the exported files to their visible size (as opposed to the artboard’s size), this will allow mouse interactions to pass around the visible area to regions behind the SVG.
Fixed an issue where layers containing only invisible items (e.g. Guides) were causing an exception.
Fixed an alignment issue which appeared if the artboard had been resized after creation.
Fixed cropping issue with large layers (and Trim option)

Edit 17/05/2013

Separated the artboard and layer selection, which now allows for more fine-grain set ups.
Now allows for ‘Trimmed Edges’ functionality for all output formats.

Edit 17/07/2013 – 28/08/2013

Now you can export Illustrator layers to FXG files (versions 1.0 & 2.0)
Added an option to ignore warnings.
Fixed ‘Save & Close’ button.
Empty child layer bug fix.

Edit 6/12/2013

Added a mode to avoid visual clipping of round backgrounds.
Thanks to John Ford for the input.

Edit 7/8/2014

I’ve changed the file naming system to be much more flexible, using a token pattern instead of the prefix/suffix fields. Try it out here.

NEW VERSION

There’s a brand new version of the tool, rewritten from the ground up, it’s way more powerful and allows for multiple image formats to be generated from a single execution.
Also, it avoids the group issue that was the cause of that annoying message box.
I’ll still be offering this version, but if you get a lot of use out of it, buying the power version would be much appreciated.

Check it out at Adobe Exchange.

166 Replies to “Export Illustrator Layers to SVG files”

  1. Nick says:

    Thank you, this script is the treasure!

  2. get_hyper says:

    This script is brilliant. But when saving as EPS, all the layers are saved as hidden layers. Is there a way to make it so the new EPS only contains the each layer without all the other hidden layers?

    1. tom says:

      Are you sure you’re using my version of the script? This is the functionality I added (i.e. exported vector files only contain the visible layers).

    2. felix says:

      hey,
      thanks for the awesome script.
      i still have the same problem though (on a mac, mountain lion, CS5). it still exports all the hidden layers. they stay hidden but enlarge the filesize unnessecarily… how to disable this? i can’t find an option in the script.
      thanks a lot for your work!

      1. tom says:

        If you’re 100% sure you’re using my version of the script (does it have the ‘Ignore Warnings’ checkbox?) then send me the Illustrator file and I can have a look (with the export settings saved into the file).

  3. Dan says:

    Hi. Love the script but when I try to export files as SVG it does not process, and some of the options are greyed out. I am using CS6 v 16.0.0 if it matters.

    1. tom says:

      Options are greyed out when the don’t apply to the selected output option. If you email me the failing illustrator file I’ll take a look.

  4. Dan says:

    Ok maybe silly on my part but when I clicked on the download link for the script it opened a text version of the script that I copied into a text file and saved as a another name other than “Multiexporter”. Reinstalling by right clicking the download link (Save Link As…) and installing it as is corrected the issue.

  5. Philipp says:

    Hi,
    great script, thanks a lot! However, it seems to be exporting all layers, not only the ones with visibility turned on… Am I doing or understanding anything wrong or is the script not doing what it is supposed to do?
    Thanks!

    1. tom says:

      That is the intended functionality, add a minus at the beginning of any layers you don’t want to export.

  6. big_smile says:

    This script used to work wonderfully, but the most recent version doesn’t.
    Layers with a + symbol are often ignored.
    I also often find that the files are outputted as .tmp files instead of the actual file format.
    (This all happens when using EPS).

    1. tom says:

      Adding a plus (+) symbol at the beginning of a layer makes it a layer which gets included in all other images (but doesn’t get an export of it’s own).
      I’ve tried to replicate your issue but can’t.
      Can you try again with the latest version and if it’s still happening send over the file?

  7. SilentTani says:

    OMG! Dude..you’re gold!
    Just downloaded and and tried out the script and almost fell off my chair when it started doing its magic! I did expect that it will work, but not this great and smooth and amazing!
    Thank you so much, honestly, I would be ready to pay for this!
    Cheers!

    1. tom says:

      Only the root layers get their own export, child layers are included in these exports.

  8. Håkan Save Hansson says:

    Thanks Tom! Saved my day!!

  9. Danny D says:

    A-Mazing ! You took his script and ran with it ! the added options… GOLD !
    You made my day !

  10. Daté TETEGAN says:

    Hi Tom,
    Very great improvement!
    But It would be so much efficient if we could get the list of document artboards and select the ones we want to export without having to change the name by adding a minus sign (-) in front of it.
    I personally use files with many artboards and i realize how painful it is to add or remove regularly the (-) sign.
    If we could have 2 columns with the list of document artboards on the left, and selected artboards on the right, it would works better.
    In the middle , different buttons like Add, Add All, Delete, Delete ALL to make the selection of artboards more easy.
    I’m very interested to get this feature, how can you manage that ?
    Can I send you a picture of what I mean ?
    Thanks,
    Daté

    1. tom says:

      Hey Daté,
      A good suggestion but I’m not sure I’ll be able to find the time required to make such broad changes.
      Can I recommend in the meantime that you have a layer called ‘-disabled’ which you can drag layers in to when you need to disable them?

  11. Vincent De OLiveira says:

    Hi Tom,
    I found your tool today and it’s awesome.
    I’ve a little problem anyway: i try to export SVG files and the message ‘Illustrator visibleBounds issue workaround’ appears, but when i disable warnings messages, the generated SVG is no longer the same as before. Seems like bounds are not correctly calculated. Any idea?
    Thanks. Vincent

    1. tom says:

      Hi Vincent,
      There appears to be a bug in Illustrator regarding getting the bounds of certain groups.
      By adding in the alert box, Illustrator has the time required to correct the bounds miscalculation, when it is disabled the miscalculation is used. Sometimes this won’t affect anything (i.e. when the bounds of other objects on the same layer completely encompass the affected object). Other times it does cause issues.
      Ideally, we’d have a process ‘chunking’ system that could be paused when the issue was detected (and restart a few milliseconds later), unfortunately I doubt I’ll have time to add that in the near future.
      If it’s practical, I’d remove the problematic groups (or replace them with child layers, which are practically the same and don’t seem to exhibit the issue).

  12. Sean says:

    Is there a way to add pdf profiles to this script? My company has ICC profiles for our printers and it would be a dream to be able to save out individual pdfs from our multi artboard files with the color profile enabled.

    1. tom says:

      Do you mean the pdf presets from the save pdf dialog?
      It can currently save out PDFs, but it doesn’t really have enough options to make it very useful. The next natural progression for this plugin would be to have a specific option UI for each file type, which would allow for this kind of functionality.
      I don’t really have the time or need to add any more functionality at the moment. I am a freelance software developer though, so for a fee I’d happily make these changes.

  13. Gabriel says:

    Hi there, You have done a great job. I’ll definitely digg it and personally recommend to my friends. I am confident they’ll be benefited from this web site.

  14. Lieke says:

    Hi Tom,
    i really would like to use your script, because it would saves me hugh of time. But when i click on your link, i get a page with only text.. How can i save this to a jsx-file?
    I look forward to a reply. Thank you very much in advance.
    Kind regards,
    Lieke.

  15. Lieke says:

    Sorry, i’ve already found it!
    Thank you very very much!!

  16. Jess says:

    Mr. Tom,
    Using Illustrator CS2 12.0.0. I placed the file in Illustrator’s script folder (Adobe Illustrator CS2\Presets\Scripts\) but when I attempt to execute I get the message box “Error 2: Window is undefined. Line 275 -> Window alert(‘Please delete the this.multiExporterPrefs layer and try again.’). Could you let me know what I have done incorrectly? Thanks.

    1. tom says:

      Hey,
      I haven’t tested the plugin in anything earlier than CS5.
      I’d be surprised if it’ll ever work in CS2 simply because the capabilities of the Javascript API have probably dramatically changed since then.
      I wish I could be of more help but I doubt I’ll find the time to support older versions of Illustrator.

  17. Andi says:

    Thanks! Life saver!!!! Works great, had some errors but that was because there where unconverted fonts hidden around.
    Thanks! U rock!

  18. Kai says:

    Fantastic. Thanks for the additions to an already great script!

  19. Sean says:

    Hey Tom,
    This is a great script thanks for modifying the original. I do have a question/request. Is there a way to export slices to SVG? I was looking to use the artboard export method, however I am building an icon font and have more than 100 assets (167 to be exact) and splitting the file up would wreak havoc on maintenance.
    Thanks!
    -S

    1. tom says:

      I haven’t looked into exporting slices, definitely something I could look into.
      If it’s practical, I’d recommend putting each icon in a separate top-level layer, then using the ‘Trim Edges’ mode to export have each exported image trimmed to the image bounds.

  20. Sean says:

    Hey Tom,
    Thanks for the reply, Tom. I’m currently looking into your recommendation but with 167 sublayers it’s damn near impossible to programmatically turn sublayers (and groups as well; some objects have compound paths and get un-merged when releasing to layers). Also, when you say “trim edges” would it trim to the edge of the artboard or to the edge of the object/layer? I’m building the font on a strict 32x32px grid and having the bounding area of the canvas retained is rather critical for alignment and positioning. Thanks again for the suggestion, I’m giving it a go manually (layer conversion) as I type this.
    -Sean

    1. tom says:

      With ‘Trim Edges’ it exports imagery using the layer bounds, without it uses the artboard bounds.
      I’m very busy at the moment but potentially I could add “Export groups/layers one level deep” at some point (I’ve had another request for this a few days ago), I’ll keep you posted.

    2. Sean says:

      Sounds good. Another, hopefully smaller feature, could be to append a dynamically generated numeric sequence. Thoughts?
      -Sean

    3. Sean says:

      I could clarify since that last comment was a bit cryptic. I meant that the filename could have a dynamically generated numeric prefix sequence and append that to the layer name for output.
      -Sean

    4. tom says:

      Yeah, at some point I’d like to add in a file name pattern system, with all types of tokens so all sorts of names can be generated. Again, unless I can tie this into paid work it’ll have to wait till I’m less busy.

    5. Sean says:

      Fair enough. This is my last question, promise. The artboards in the exported SVG’s end up centering around the vector object just fine but the artboard does not snap to a pixel. Is there a way to add that as a function? I’ll try and look into the modifications myself as well but I ask since I’ve had no luck.
      -Sean

  21. Robb says:

    Tom,
    I have this amazing script but i cannot get it to export the various sublayers. I have even reduced these to sequence layers and still no result. only shows i am looking to export two layers in total. What am i doing wrong in this script. I have tried to organize my layers for batch exporting some labels with various UPC’s and flavors. Instead of turning off an on each of these and deleting info i want to export only those visible layers that are common across the file and those specific elements designated for each flavor. Please advise.

    1. tom says:

      Hey Robb,
      Sounds as if you’re trying to do something quite specific, not sure if my script will help. It currently only exports top-level layers, not sublayers.
      Also, if you want additional layers to be included in all exports, begin the layer name with a plus symbol (+).

    2. Robb says:

      Tom, Thanks for the reply. Yes i am trying to get this to happen with sub-layers. Even so CS5 maintains at least one top level layer. The way the file is setup, i have main background layer which needs to be visible on each new file, a common information layer which needs to be visible in each file, and the flavor names and upc info pertaining to each flavor in another layer. My total file count for 140 + flavors with six variations for each across 5 different sizes will net me around 4500 individual files for my client. Needless to say my desire to automate this is critical. I have to export in eps format to accommodate their specific printing software to recognize a spot color for cutting. I can now get the script to see five layers so i am trying to figure out how reduce my flavor layers to individual layers while maintaining their layer names. i have searched high and low and this is the closest thing i have found so far. I am also not a programmer so this is far beyond my technical level. Any help you can offer would be greatly appreciated.

  22. John says:

    Hi Tom – wondering if there’s a way you can create an option to export all of the selected graphics/objects into a new Illustrator file or new artboard, instead of exporting them to a directory? If exporting to a new artboard or file, + still exporting to a new directory is an option, well, that’d be fantastic.
    Asking about this per sometimes we designers need to make UI Kits (for those that don’t know, a summary of all graphics combined into one document) to hand off to clients. I’ve been creating multiple artboards and normally have to open a new file, then copy and paste all assets (either importing symbols I’ve created or manually copying and pasting) into one main document as a summary of all graphics created (the UI Kit).
    If a user checked this ‘export to new art-board or new file option’: 1) they’d all have to be placed evenly apart from one another, maybe the user could selected how many pixels apart each object would be in the the new UI Kit or maybe there’s a default 2) would be great if we had the option to include the name of the element (maybe taken from the layer name) beneath or beside it. Sometimes I include file names in UI Kits so that developers know what’s being referenced. 3) user may have to select the file dimensions.
    Thoughts on if this is possible?
    Thanks – John, using Adobe Illustrator CS6, Mac

    1. tom says:

      Hey John,
      It’s possible to do either, although generating artboards is quite different behaviour to the current functionality, so I’m reluctant to add this into the open source tool listed here.
      Regarding exporting AI files, this is definitely doable, although considering how busy I am currently, I doubt I’ll have time to do it for at least 2 months.
      If you were interested in paying for either or both of these features please contact me via email

  23. Paul Greenstein says:

    Great work! Just what I was looking for as I needed to port an old Illustrator Layer-based Flash project into Edge. Managed half an hour wondering why SVGs pixelate when you scale them in Edge – discovered in the end that you have to use the Width/Height properties instead of the transform tool. Still, you saved me a lot of time.
    Thanks
    Paul

  24. Rick says:

    Hey Tom. I cannot get the export to SVG to work right. I have 30 artboards. I want them to be exported to 30 separate SVG files. No matter what I do, I get the first SVG based of artboard one to come out with layers in it, but the other 29 are blank. I have tried every variation of the options. If i do each individually, then they come out fine. Can you tell me what I am doing wrong here. Each artboards artwork has its own layer and child layers. None crossover. Thanks.

    1. tom says:

      Hey Rick,
      It’s difficult to say what’s wrong without having a look at your AI file.
      If you’re comfortable with it, email it over and I’ll take a look.

  25. Marquita says:

    I got this site from my friend who informed me regarding this website and now this time I am visiting this site
    and reading very informative posts at this place.

  26. Mark says:

    Totally amazing script and has saved me loads of time exporting retina graphics. Thanks so much and would happily have paid for this.

  27. Robert Lindgren says:

    Thanks for the great script.
    I have a situation where the foreground that is static for the artboard, then a layer-group with different backgrounds (diff color). I’m not sure but there is not any way to export that with the current version of the script so that I will end up with the images with same foreground and different background?

    1. tom says:

      If your foreground layer’s name begins with a plus symbol (+) it will be included in all exports (i.e. one for each background layer).

  28. Rick says:

    Hi,
    Excellent script! Is there any way to stop files getting ‘-01’ appended to the filename? I’m running it in the latest Illustrator CC version on Mac OSX 10.9.2.
    Thanks!

    1. tom says:

      Maybe there is some change in CC (which I’m not using yet) but I’ve never seen this behaviour before. If you emailed me your AI file I could have a look, otherwise I’m at a loss.

    2. Jayne says:

      I noticed I was getting -01 appended to my file names too, but since i was renaming everything anyways it didn’t bother me too much. I use an app called “ABetterFinderRename” to batch rename things quickly.

  29. Jayne says:

    Thanks for the script, it was exactly what I was looking for. Saved me lots of time 🙂

  30. Alex Paredes says:

    Hi, Your Script looks awesome. But im trying to make it work. im using Illustrator CS4. My problem is that i’m getting the following error message.. ” Error 21: undefined is not an object. Line: 547->if(!artboard.name.match(/^\-/)){ ”
    any idea?

    1. tom says:

      Hi Alex,
      I haven’t tested the script on anything before CS5, so I’m not sure what could be wrong there.
      If I had more time on my hands I could look further into it but it’s not really possible at the moment, sorry.

  31. guy says:

    first of all thanks to both of you for such a wonderful script !
    here’s my contribution to windows users that are trying to export a gazillion layers and don’t have the time or patience to dismiss the dialog box – works great for me 🙂
    http://pastebin.com/q1Q7UmwC

  32. Luis says:

    Hi. this is an excellent and usefull script. i only miss a way to add class names to nodes, so we can use them in CSS styling
    cheers

    1. tom says:

      Hey Luis,
      How do you see this working?
      Which type of elements would you want to style?

  33. Ali says:

    Great script, thanks! The bug in get_layer_bounds is very annoying, I have ~90 layers that each contain 1 compound path and can’t find a way to stop this error occurring ~90 times. If I add the compound path to a child layer I still get the error.
    Any idea if this bug is documented anywhere on the Adobe forums? Anywhere I could read up a bit more? Is there a wait/timeout command that could be used instead of popping the dialog?

    1. tom says:

      Unfortunately there is no type of wait function in JS. There is a setTimeout, but this would require significant refactoring of the code, which I don’t really have time to do at the moment.
      You could try selecting all and ungrouping everything several times before running the tool (obviously don’t save these changes). The issue is normally caused by groups which report incorrect boundas.

  34. Andreas says:

    I love your script!
    Is there a way, to multiexport and simultaniously flatten the artwork for each exported svg-file? My dream: By Clicking a checkbox in your export-dialog , this function would produce svg-files with just one layer.

    1. tom says:

      I’m not sure I understand.
      Because SVG is all vectors there will always be ‘layers’ of some sort.
      The script really just hijacks the built-in svg export, so there isn’t much control over the resulting file. If there is some pre-processing that is currently available in Illustrator that you’d like done before export (e.g. using the Pathfinder or whatever), that is possible.

  35. Sascha says:

    Hi Tom.
    Thank you for improving Matts script (which I used a lot). Now this is near to perfect!
    I have the same issue like “Rick – DECEMBER 14, 2013 AT 5:26 AM”:
    Working with multiple artboards all layers are exported using the uppermost artboard in the artboard-list. This is the case when trying to export a specific artboard other than the first one in the list. If I make the desired one the first in the list pre-export it´s okay.
    It´s also doing well using the default-options “All artboards, all layers” – but then the files are artboard-prefixed, which I have to remove via total commander.
    So the combination I´m looking for is “Specific artboard (e.g.2), selected items´ layer” resulting in filenames based on layers without artboard-prefix only for desired layers.
    For now I workaround this with rearranging the artboards pre-export, but if this could be fixed it would be one error-source less.
    Thank you and kind regards.
    Sascha

    1. tom says:

      Hey Sascha,
      I do intend to make the artboard/layer selection more flexible in the future, but for now hopefully the new file naming system will get you over the line, It’s linked in the last update above (7/8/2014).

  36. Jon says:

    Great stuff. Do you know what settings the SVG version is set to? Is it SVG 1.1?

    1. tom says:

      Hey Jon, yeah, it’s v1.1, it just uses the exporter that is used when you use Save As > SVG

  37. Julia says:

    You are a god!
    I couldn’t get Matthew’s original script to run but your revised version runs perfectly. Mac 10.6.8 snow leopard, CS6. Thanks!

  38. lalit says:

    you are f*cking awesome.
    thank you very to save time.

  39. barbaClemens says:

    Thank you, this script saved my day… and a whole lot of time!

  40. Chris Harrison says:

    Tom — Brilliant script. Saved me a world of headaches with some icons I’m working on for a webfont. Having some problems with SVG export when multiple artboards/artboard sizes are present. It looks like the script defaults to using only one artboard when exporting. This has resulted in having the majority of SVGs created being clipped out from final artwork. Short of exporting from one artboard at a time, is there any way to potentially fix this?

  41. Ivor says:

    Hy Tom,
    your add-on looks great. Tried the free version, and it’s awesome, but i like the new feature of selecting the art boards that i want to export so i tried purchasing it on Adobe Exchange. Installation was ok, but when i try to run the script i keep getting 2 errors:
    Error: Invalid enumeration value
    and when i press ok
    TypeError: undefined is not an object
    It just doesn’t work…
    I am using updated illustrator 16.0.4 on cs6 on mac osx 10.7.5
    installed the add-on with adobe extension manager cs6.
    Can you help me?

    1. Ivor says:

      Tom,
      thanks a lot for your time and effort. Your quick update fixed my problem and now the script is working great!

  42. Bruno says:

    Awesome script! Saved me a ton of time. Works great on CC2014 for Mac. I’m also exporting some frame by frame stuff into edge, and this is exactly what I needed . Thanks!!

  43. Alex says:

    Hi, I stumpled upon your script and found it very helpful for exporting pngs. However, I have some troubles with the svg export (Mac, AI CS5). Although I avoided different artboard sizes, the script seems to shift the icons from their original placement, resulting in empty pages or misplaced icons. I’d like to try your new version at Adobe Exchange, however there’s the note, that it is only compatible down to CS6. Is that true?

    1. tom says:

      Yeah, this is a limitation of Adobe Exchange.
      It would work in CS5/CS5.5 with a few changes but I just don’t have the time to support more than the last 3 versions.

    2. Alex says:

      What a pity – sigh! But thanks for the free script anyway. Great work!

    3. Alex says:

      I’ve found a workaround: First off, I’m exporting all icons to PDFs (using the script). Afterwards I’m using an Illustrator action, that saves the single page PDFs as SVGs in batch processing.

  44. Mariusz says:

    Hi, I just bought plugin for Adobe Exchange and work good expect one thing what is very important for me. The saved setting doesn’t load correctly. I create a few settings and when I load from list the all options loading in fields but when I export it each time give me error. I think there is something wrong with setting loading function. There is no way to load setting and run export.
    Can you take a look on this issue please ? Thanks!

    1. tom says:

      Hi, please contact me via email and I’ll have a look into it.

  45. Jeff says:

    thanks! made my morning much easier…. I’m heading over to the Adobe Exchange to pickup the other version too.

    1. Jeff says:

      Just opened the smart layer export…. great!

  46. daniel says:

    Hi, is there a way to avoid the -01 in the generated files?

    1. Caleb Clauset says:

      FYI, I’m still seeing the -01 appended to generated files. Also, it seems that (at least in Illustrator CC 2014) something is odd about the layer order in the generated files. I had to disable the ZOrderMethod.BRINGFORWARD and ZOrderMethod.SENDBACKWARD calls from if(isVis) to preserve my intended layer stack order.

  47. Jake says:

    Cool idea, but man, this script takes so much longer than Matt’s. What’s the deal?

    1. tom says:

      Matt’s script shows and hides layers then saves a file out. This doesn’t work for vector file types (which include even hidden layers in their file size) as well the ‘Trim layers’ option in my version, which requires the document to be a different size. If you’re doing non-trimmed raster exports, like Matt’s script does, then they should take approximately the same time.

  48. Mark says:

    This script has saved the day! Thank you for the amazing work. I look forward to using it in the future again. Amazing!

  49. George says:

    I have a file with about 80 layers. The contents of any given layer may be grouped, a compound path, or neither and each may contain a few to 100+ paths. When I run this script, a few layers are exported and then I get a failed message: “10 layers failed across 1 artboard”. I have tired cutting back to only a few layers, rasterizing and tracing each layer, removing groups, adding groups, and compounding paths to see if I could put my finger on where the failure was occurring at without any luck. I am not terribly familiar with javascript and I was hoping you might have suggestion on what might be causing the failure.

    1. tom says:

      Hey Audrey,
      Have you got a document open when attempting to open the export panel?

  50. James says:

    Hey Tom,
    Thanks so much for your script, I feel so much happier to work with developers now, you have taken so much tedium from my life. The ‘trim’ function is spot-on!!! Brilliant…it’s what I felt other scripts and plug-ins missed – everything should export at a standard size generally.
    How Adobe cannot keep an eye on their competitors such as Sketch – which has fantastic and easy exporting options – and not include better functionality like theirs for exporting is beyond me. You are superman as far as I’m concerned! Closing the gap between this lagging giant and it’s competitors by your skill and generosity. Bless you.
    You lil’ beauty!
    Have a nice day
    James

  51. kemie says:

    I’m trying to buy the new script version at adobe addons. However, I get a 404 error when I try to go through the purchase process. (I hate adobe’s site!). Any chance of buying through another channel?

    1. tom says:

      Hi Kemie,
      At the moment I haven’t listed it for sale anywhere else, sorry.
      Apparently you can use the Extensions panel from within CC apps now though, if the site isn’t working for you.
      More Info here

  52. Darren says:

    It keeps giving me the error “Reference Error: docRef is undefined”… help?
    I’m using the extension from adobe with illustrator CC

    1. tom says:

      Hey Darren,
      Have you got a document open before you open the panel?

    2. Darren says:

      I do yes, I open my document, then go to scripts -> Smart Layer Export

    3. Raj says:

      I have a similar error when I do a Smart Layer Export. The error reads:
      ReferenceError: smartExport.ExportToolBuilder does not have a constructor. I’ve been using this successfully until today – so I am wondering if Illustrator CC updated behind the scene and something is imcompatible?
      Thanks!

    4. Raj says:

      I fixed the problem by re-installing the add on. I had to change my Mac account to have admin privileges to successfully install the add-on.

  53. Andrew Watson says:

    This looks amazing but I’m trying to export each layer as .jpg but with one other layer as well. So I have a layer for text above several colours, each in a different layer. I need each colour exported but with the text on it. Could you suggest a modification to do this? or is this in the too hard basket?

    1. tom says:

      As mentioned in the Notes section, if you begin a layer name with a plus symbol (+) it will be included in all layer exports. This also applies to the paid version available at the Adobe Add Ons site.

    2. Andrew Watson says:

      Thanks a lot! …. I’ll be honest, I read as far as putting a minus in front, sorry for asking a dumb question.

  54. Marc says:

    Great script! Thanks for providing.
    Can you add the option for export svg responsive.
    Thanks in advance!

  55. Sebastian says:

    Hey Tom! Was wondering if your Smart Layer Export (in Adobe Add-ons) supports multipage pdf export. I have a file with 2 artboards but I want both to be in a single PDF file.
    Thanks!!

  56. Haikal Aziz says:

    Thank you so much for this Tom! One thing though, illustrator sometimes quit unexpectedly when I’m trying to export the artboards. Anyone else experiencing the same problem? Other than that it’s really freaking fantastic! 😀

    1. tom says:

      Hi Haikal,
      If you email me the AI file that is causing crashes I can take a look.

  57. kemie says:

    I have a bug report on the version on Adobe exchange, a weird one. If i try and type anything into the filename pattern fields, the text is input backwards. For example, I type “h” “e” “l” “l””o” and the field will show “olleh”. To type anything I have to type a letter, move the cursor, type another letter, etc.
    This happens on illustrator cs6 running on osx yosemite, and does not happen in any other illustrator inputs.

    1. tom says:

      Hi Kemie,
      Thanks for the feedback, this will be fixed in the next version (v3.6)

  58. Petr Chutny says:

    Hi, thank you very much for this very useful script! Been using it for two years now 🙂

  59. Lunabe says:

    thank you so much sir for this script. usually i can save bulk layer to file using photoshop but the quality isn’t good. I try to draw several artwork and save it per layer as .PNG, the result is very good. I mean good for me because I can save my time.

  60. MCE says:

    How do I download this as the jsx file for a mac? Newbie here!

  61. Vince says:

    Hi Tom,
    Thanks for your awesome work!
    Should this work with AI CS4? I get an “Error 21: undefined is not an object
    Line 546: –> if(!artboard.name.match( /^\-/ )){ ”
    (i know, i know… i really should pony up the cash and upgrade my AI…)
    but if there’s an easy fix to this so that i can run your awesome script, it would be greatly appreciated!
    best–
    Vince

    1. tom says:

      Hey Vince,
      I’m not sure what is going wrong there, I’ve never attempted to run it in CS4. I’d love to help but I just don’t have the time to support versions that old, sorry.

  62. Thierry Charbonnel says:

    Nice job. amazing tool !
    change in copy_layer

    if(oldBounds && newBounds){
    offset.x += oldBounds[0]-newBounds[0];
    offset.y += oldBounds[3]-newBounds[3];
    offset.norm = true;
    }

    to

    if(oldBounds && newBounds){
    offset.x = oldBounds[0]-newBounds[0];
    offset.y = oldBounds[3]-newBounds[3];
    offset.norm = true;
    }

    works for me to export SVG multy-artboard.

  63. Justin says:

    Is there an ETA on the update with CC 2015?
    I just found this and I’m excited to give it a try, but the Adobe Exchange link says the product not exist.

    1. tom says:

      I think Adobe disabled all of the plugins for a little bit while they retested them, but it appears to be active now.
      I have tested with CC 2015 on OSX and Win64 and all seems to be working fine, let me know if you still can’t get it to work.

  64. Jeremy says:

    Do you know if there is a script out there (like this one), that will run an export based on my saved “views”?
    I’ve created heaps of views using
    Menu>View>New View
    And I want to export all my views, on the same artboard, to jpg, tif, png, pdf, etc.
    Any advice would be appreciated.
    Cheers,
    Jeremy

    1. tom says:

      I’ve never seen one, although it has been requested before, so I may make a variant of my paid Exporter (Smart Layer Export) with this functionality. Keep an eye on my blog over the next few months.

  65. Ivo says:

    The current version isn’t working for me. Is there (or will there be) a CC2015 version available?

    1. tom says:

      You will have to reinstall after installing CC2015, the current version should work.

  66. Stacy says:

    Hey Thomas,
    Much Appreciated ~ !
    The Script is Great and Really Helped alot, since I had to work with over 1000+ icons in 50+ AI and spit out all of the SVG, PNG and iconfont for our Library Collection.
    I am Wondering, Would You be considering to work in an added Option, where we can Input any #HEX Colors in your provided Panel and have it process / export it to that single Color ?
    There are some Linux command types + scripts that I know of; and takes all specified SVG and convert them with lightning speed.
    But Just thought it AIN’T too Cool doing that separately & (non-consistently generating the files from the same plug-in)
    Hoping to see if it would be a nice extra … My2Cent < Your thoughts ?
    Cheers
    Stacy

    1. tom says:

      Hey Stacy,
      This would be possible for some, but not all elements in an Illustrator file. Paths and text would be possible (which I’m guessing will be the most useful).
      I might add this functionality to my paid plugin (Smart Layer Export) in the future, but not to this version (which I don’t really support any more).

  67. Carla says:

    Great – i didn’t even had to use my brain. Thanks!

  68. Chris says:

    Thank you so much for this – it turned a morning’s work into ten minutes work and saved my sanity that day. Let me know if you’re ever in Oxford, UK – i feel like I owe you a drink or five

  69. Pingback: Quora
  70. Adam Sabla says:

    Thank youuuuuu!!!!!!!!!!! You just made my life beautiful!

  71. J Valentin says:

    Hi Thomas,
    I know this is an older post but I’m currently facing another Illustrator to SVG issues. I’m working with a new plotter, the FORCE, by knkusa.com, and it works well with SVG files created by other apps, like inkscape and Make-The-Cut, but not with Illustrator files. According to the manufacturer, Illustrator has some additional info in their SVG files which screws up the output. Is there a way to simplify the output file and make it more compliant with industry standards?
    Thanks for your help.

    1. tom says:

      Try disabling “Preserve Editability” when you export from Illustrator.
      That should make it a fairly standard SVG file.
      That said, there are a lot of different ways to do the same thing in SVG, so potentially Illustrator is doing something that your plotter software doesn’t like.

  72. Diego Gouvea says:

    Hey Thomas,
    is this power version compatible with the latest version of Ai?
    i bought it but isn’t showing on my app.

    1. tom says:

      Hi Diego,
      It is compatible with the latest version, I’ve sent you an email to help get it installed.

  73. Glenn says:

    Question. I in the Adobe Exchange review for the power version, there is a comment about the exports being “LOW quality.” Is this true, or is there a way to maximize quality for good use when printing?

    1. tom says:

      This plugin piggy-backs on the native Illustrator export functionality, so all options available in either “Save as…” or “Export” should be available in one form or another.
      Some settings (like Quality) are format specific, and need to be accessed with the “More Options” button when the format is selected.

  74. Carl says:

    Wow, thanks for updating this. It’s come on some much since I used the original. I would really love it if you could make the layer name optional(none/prefix/suffix) as it’s something that would be really useful to my workflow.
    I can’t wait to see how this develops in the future. Keep up the great work

  75. Tudor says:

    The script works very well and is useful, but I have a question. For the PDF export, is it possible to add some options for optimizing images? Like JPG compression options (resolution, quality). Thank you for the excellent work!

    1. Tudor says:

      Or instead of adding image optimization options for PDF export, is it possible to select from the existing PDF export presets available in Illustrator? That would be even better.

    2. tom says:

      Hey, I’ve added both of these features to the next release of the paid for version of this tool (v3.16).
      You’ll be able to select a PDF preset from the list provided by Illustrator (you should be able to save your own through the normal Illustrator PDF save dialog). Selecting a preset will disable the “More Options” button.
      Also, many more PDF settings will be available in the PDF settings panel, which will now more closely resemble the Illustrator one (to help legibility).
      You can buy the tool here:
      https://creative.adobe.com/addons/products/2955

  76. Adam says:

    I recently purchased your commercial plugin thinking it would save me hours of work, however all of the ‘dropdownlist’ elements seem to be getting cut off and not displaying the majority of items or allow me to scroll. I’m not sure whether this is caused by coding, the version of Illustrator or it’s simply a bug. I’ve uploaded a screen shot to demonstrate the problem, I’d appreciate any advice on how to resolve this, my current solution is changing the ‘dropdownlist’ elements to ‘listbox’ but it’s not ideal.
    OS: Windows 10 64bit
    Illustrator: 2015.2.1 Release (19.2.1) 64bit
    https://s14.postimg.org/n3yhires1/illustrator_problem.jpg

    1. tom says:

      Hi Adam,
      This is an Illustrator bug relating to HighDPI screens in Windows.
      I logged a bug report with Adobe well over a year ago, but I doubt they’ll fix it any time soon.
      In the short term you can work around this by turning scaling back to 100% in Windows (In display settings). Not very practical, but it’ll work.
      In the long term I will have to use different UI elements to achieve the same thing, but I’m not sure I’ll find the time to do this for a little while.

  77. Sam says:

    I have 20 columns with 71 artboards on 20px * 20px, when using the script with all artboards it doesn’t get the right vector outline for the artboard. When I just select that faulty artboard by itself it exports the correct vector outline.. too bad.. :'(

    1. tom says:

      Sorry, this script is not supported anymore.
      If you’re having issues with my paid version Smart Layer Export, let me know.

  78. Brandon Durham says:

    Heya… I’ve used this script several times before and it’s been so incredibly helpful.
    I wonder, though, is there a way to make it crop the SVG to the size of its clipping mask instead of the size of its contents? I have about 30 “tiles” of art in my file, each on its own layer. Each tile has text in it that runs outside of the bounds of the tile, so a clipping mask is applied. When I use this to export it seems to use the size of the contents instead of the mask, leaving me with an SVG that has a lot of extra whitespace.
    Suggestions on a tweak to make it rely on the size of the clipping mask?
    Thank you!

  79. Paige says:

    Thank you so so much!! Really appreciate it:) Worked a treat

  80. Paige says:

    Hi Tom,
    Thanks so much for the script:) It’s brilliant. Sorry if it’s obvious but is there any way to change the resolution of the exported files? Happy to purchase the paid version but it looks like it doesn’t work with CC2017.

    1. tom says:

      Hi Paige,
      Sorry, previous reply was misdirected.
      The paid version is compatible with CC2017, although people do have issues installing it (thanks to factor’s outside my control).
      If you do get the paid version and have issues installing it, contact me and I will be able to help.
      In the paid version, all raster export targets (JPG, PNG, etc) have a scale setting, to change the target resolution.
      Some of the vector targets (SVG, etc) also have a scale factor, depending on which underlying exports support this setting.

  81. Ted says:

    Hi Thomas,
    I just wanted to thank you for the awesome script. I also wanted you to know that the way that your script is writing SVGs solves a bug in IE.
    I am using grumpicon to condense my SVGs into an inline stylesheet, and when submitted to the dev team of my company, they noticed that IE was rendering them in all black, and it’s a well documented bug: https://github.com/scottjehl/Device-Bugs/issues/74
    However, your script writes the SVGs in a way that negates this bug, so thanks!

Comments are closed.