Copy link to clipboard
Copied
Hello community !
I am looking for a way to export individually each layer in Illustrator as PNG, JPG or any other format.
I've seen this video :
https://www.youtube.com/watch?v=_9MX2moFX4A
Featuring this script :
http://www.ericson.net/content/2011/06/export-illustrator-layers-andor-artboards-as-pngs-and-pdfs/?f...
But the script doesn't seem to work properly on my Illustrator CC 2020 version.
I know the "export asset" functions, as well as "save for screens" and "save for webs". But if you had a quick way to just tell Illustrator "Hey, take every individual layer existing, and export them into separate PNG files please".
It would be great for my workflow.
Thanks !
Copy link to clipboard
Copied
Try this: MultiExporter.jsx
Copy link to clipboard
Copied
No longer works in CC2022 (v26.5). Worked in 2020 when I last used it, not now.
It's absurd that exporting a PSD from Illustrator (or opening an .ai file in Photoshop) doesn't reliably preserve layers.
Copy link to clipboard
Copied
Not work in cc 2023
Any help !!
Copy link to clipboard
Copied
What does not work for you? Works fine for me in 27.8.1
Copy link to clipboard
Copied
I want to export each group of each layer as a separate file instead of export whole Ai file to psd and then export as png or jpg
Copy link to clipboard
Copied
The script does not export sublayers separately.
Copy link to clipboard
Copied
Do you know any script to do that ?
Thanks in advance
Copy link to clipboard
Copied
I am not aware of such a script.
Copy link to clipboard
Copied
Thanks
Copy link to clipboard
Copied
Yes, tried this too. The script seem to be not updated for latest version of CCs
Copy link to clipboard
Copied
Works for me, what may not be obvious at first, even if you don't want to export artboards, you have to select an artboard (to tell where the layers are).
Copy link to clipboard
Copied
It works for me too, fantastic script for automation exports ! It really save my time !
Copy link to clipboard
Copied
I believe I have the artboard selected, but alas, it still says "Will export 0/242 layers on Artboard 1".
Copy link to clipboard
Copied
I have the same issue, does not seem to work on 2023 Ai CC, something illustrator could add so easily
Copy link to clipboard
Copied
Do you use this version?
Copy link to clipboard
Copied
Yes. It's the same version we've been talking about throughout this whole conversation. It's identified within the script as v0.6 dated 2013. It doesn't work. Doesn't show up in the Script menu if it's placed in Illustrator's Scripting folder, doesn't work if you just try running it direct from the file. If it's doing anything, it's failing silently. No dialogue box or error is displayed. And yes, I have layers/artboards selected.
Copy link to clipboard
Copied
AI scripts are forward compatible. Any script that worked in 2013 should work in 2023.
Copy link to clipboard
Copied
And yet…
Copy link to clipboard
Copied
I made this today, it exports all layers for "Export for web" and at 1200px x 1200px, I'm sure you could alter it to your needs, but like you nothing was working for me. It wont let me upload a file with a .jsx but if you download visual code studio you can save the below text as .jsx
// Define the export folder path (change as needed)
var exportFolderPath = "~/Desktop/ExportedImages/";
// Create the export folder if it doesn't exist
var exportFolder = new Folder(exportFolderPath);
if (!exportFolder.exists) {
exportFolder.create();
}
// Set the desired export size
var exportWidth = 1200;
var exportHeight = 1200;
// Get the current Illustrator document
var doc = app.activeDocument;
// Loop through layers
for (var i = 0; i < doc.layers.length; i++) {
var layer = doc.layers[i];
// Check if the layer is visible
if (layer.visible) {
// Hide all other layers
for (var j = 0; j < doc.layers.length; j++) {
if (j !== i) {
doc.layers[j].visible = false;
}
}
// Set the layer as the active layer
doc.layers[i].hasSelectedArtwork = true;
// Define export options for "Export for Web"
var exportOptions = new ExportOptionsPNG24();
exportOptions.transparency = true;
exportOptions.horizontalScale = exportWidth / doc.width * 100;
exportOptions.verticalScale = exportHeight / doc.height * 100;
exportOptions.artBoardClipping = true;
// Define the export file path
var exportFile = new File(exportFolderPath + layer.name + ".png");
// Export the layer using "Export for Web"
doc.exportFile(exportFile, ExportType.PNG24, exportOptions);
// Deselect all artwork
doc.layers[i].hasSelectedArtwork = false;
// Restore the visibility of all layers
for (var j = 0; j < doc.layers.length; j++) {
doc.layers[j].visible = true;
}
}
}
// Close the original document without saving changes (optional)
// doc.close(SaveOptions.DONOTSAVECHANGES);
Copy link to clipboard
Copied
You just need to be in an artboard selection mode, not the normal selector(V) mode.
Select the Artboard Tool then run the script and you will be good to go.
You welcome.