• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Export Illustrator layers to separate Illustrator files?

Community Beginner ,
Apr 22, 2010 Apr 22, 2010

Copy link to clipboard

Copied

Does anyone know of a way within AI CS4 to export layers to separate .ai files? Or third party plug-in to do the same? Preferably retaining the layer name as the new file name.

I have a layered .ai file with 40 layers of logo versions that I need to export to separate files and I'd like to avoid the obvious "save as" and delete layers route.

Thanks in advance.

Views

57.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 22, 2010 Apr 22, 2010

Try this. Cut and paste into a text editor and save as a plain text file with a .jsx extension. You can either place it into your AICS4>Presets>Scripts folder and restart AI or just run it from File>Scripts>Other Scripts.

//////////////Start

var doc = app.activeDocument;
   
if (documents.length > 0){
       
    // Create the illusrtratorSaveOptions object to set the AI options
    var saveOpts = new IllustratorSaveOptions();
   
    // Setting IllustratorSaveOptions properties.
    saveOpts.embedLin

...

Votes

Translate

Translate
Adobe
New Here ,
Jul 08, 2021 Jul 08, 2021

Copy link to clipboard

Copied

LATEST

Nevermind, just added "[i]" to the doc.layers in line 25 and seems it's working now.

var doc = app.activeDocument;

if (documents.length > 0) {

// Create the illustratorSaveOptions object to set the AI options
var saveOpts = new IllustratorSaveOptions();

// Setting IllustratorSaveOptions properties.
saveOpts.embedLinkedFiles = true;
saveOpts.fontSubsetThreshold = 0.0
saveOpts.pdfCompatible = true


if (doc.saved == false) doc.save();

for (i = 0; i < doc.layers.length; i++)
if (doc.layers[i].locked == false) doc.layers[i].visible = false;
fullDocName = doc.fullName;
var param = doc.name.split('.');
realDocName = param[0];
for (i = 0; i < doc.layers.length; i++) {
if (i - 1 < 0) doc.layers[i].visible = true;
else {
doc.layers[i - 1].visible = false;
doc.layers[i].visible = true;
}
if (doc.layers[i].locked == false) {
docName = realDocName + doc.layers[i].name + ".ai";
var saveName = new File(doc.path + "/" + docName);
doc.saveAs(saveName, saveOpts);
}
}
doc.close(SaveOptions.DONOTSAVECHANGES);
doc = null;
app.open(fullDocName);
}

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 07, 2010 Jun 07, 2010

Copy link to clipboard

Copied

Visible or not. Does anybody know how to export layers with content only and skip those without? (so to say **content aware** for Illustrator ; )

( if that matters: .js for PC would be great )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 07, 2010 Jun 07, 2010

Copy link to clipboard

Copied

Not sure. Sorry.

Why not export everything and just delete the empty files?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 08, 2010 Jun 08, 2010

Copy link to clipboard

Copied

Thats the way I do it right now

But think of five docs a day including 6 or more basic (must have) layers using only 2 or 3 of them frequently depenting on the content.

I once saw a script exporting only layers with content, unfortunatelly I don*t know which it was and where to get it from.

(and I*m curious of course ; )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 14, 2012 Apr 14, 2012

Copy link to clipboard

Copied

Holy smoke! This script is just the ticket! Thank you so much. You have saved me hours of work. I'm looking for a way in import individual layers from one Illustrator files into Apple Motion 5, so I can animate each layer independently. Again, thank you!

Tom

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 13, 2016 Jun 13, 2016

Copy link to clipboard

Copied

Try this script: Layer Export

This is the only one that worked for me

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 20, 2016 Dec 20, 2016

Copy link to clipboard

Copied

Opps this is gud. But artboards are not been deleted it is available in all the ai files.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 23, 2017 Mar 23, 2017

Copy link to clipboard

Copied

Does anyone know of a way to export the selected layers to separate .ai file? I have a layered .ai file and I need to export only selected layers in separate files and would love to avoid ctrl-c ctrl-v to a new file, however, each layer .Thanks in advance.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 23, 2017 Mar 23, 2017

Copy link to clipboard

Copied

fabio3093  schrieb

Does anyone know of a way to export the selected layers to separate .ai file? I have a layered .ai file and I need to export only selected layers in separate files and would love to avoid ctrl-c ctrl-v to a new file, however, each layer .Thanks in advance.

This thread looks like it covers CS4. Or maybe CS6. Or maybe CC? Which is your version?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 24, 2017 Mar 24, 2017

Copy link to clipboard

Copied

i use the CC version

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 24, 2017 Mar 24, 2017

Copy link to clipboard

Copied

Immagine.png

I would like to extract only selected layers

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 24, 2017 Mar 24, 2017

Copy link to clipboard

Copied

  schrieb

Immagine.png

I would like to extract only selected layers

Check if the Javascripts do that for you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 24, 2017 Mar 24, 2017

Copy link to clipboard

Copied

I saw that it should be possible using vbscript.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 24, 2017 Mar 24, 2017

Copy link to clipboard

Copied

it sounds like it should be possible, but it's best if you make your own topic on the scripting board to ask:

Illustrator Scripting

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 24, 2017 Mar 24, 2017

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 24, 2017 Mar 24, 2017

Copy link to clipboard

Copied

I said that badly. I would like to extract a specific group of one layer and can save it in a different file.ai

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines