Skip to content

Instantly share code, notes, and snippets.

@averydev
Created September 11, 2015 16:13
Show Gist options
  • Save averydev/08f8f5afef620daef206 to your computer and use it in GitHub Desktop.
Save averydev/08f8f5afef620daef206 to your computer and use it in GitHub Desktop.
var doc = context.document;
for (var i = 0; i < doc.pages().count(); i++) {
var page = doc.pages().objectAtIndex(i);
for (var j = 0; j < page.artboards().count(); j++) {
var artboard = page.artboards().objectAtIndex(j);
for (var k = 0; k < artboard.layers().count(); k++) {
var layer = artboard.layers().objectAtIndex(k);
parse(layer, k);
}
}
}
function parse(layer, level) {
if (layer.class() == MSLayerGroup) {
for (var i = 0; i < layer.layers().count(); i++) {
parse(layer.layers().objectAtIndex(i), level + 1);
}
} else if (layer.class() == MSTextLayer){
if ( layer.fontPostscriptName() == ".HelveticaNeueDeskInterface-Regular") {
log("Found one!" + layer.name());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment