Skip to content

Instantly share code, notes, and snippets.

@Plastickid
Forked from KennyRedman/0_Export-Layer-Names.js
Created October 22, 2020 14:15
Show Gist options
  • Save Plastickid/1674f88f45167016d78c9329fb2331ab to your computer and use it in GitHub Desktop.
Save Plastickid/1674f88f45167016d78c9329fb2331ab 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();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment