Skip to content

Instantly share code, notes, and snippets.

@KennyRedman
Created May 19, 2014 18:53
Show Gist options
  • Save KennyRedman/33f769be0b0f942f2a9b to your computer and use it in GitHub Desktop.
Save KennyRedman/33f769be0b0f942f2a9b to your computer and use it in GitHub Desktop.
Adobe Illustrator script that exports layers as CSV file
#target illustrator
main();
function main(){
if(!documents.length) return;
var doc = app.activeDocument;
var docTitle = doc.name;
var docTitle = docTitle.substring(0, docTitle.length - 3);
var textFile = File('~/Desktop/' + docTitle +'_Layers.csv');
var docText = '';
for (var i = 0; i < doc.layers.length; i++) {
var currentLayer = app.activeDocument.layers[i];
docText += currentLayer.name + '\r';
}
textFile.open('e');
textFile.write(docText);
textFile.close();
}
@liuzc188
Copy link

Thank you, KennyRedman, very useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment