Created
September 11, 2015 16:13
-
-
Save averydev/08f8f5afef620daef206 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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