Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var selection = context.selection
var shapeGroups = []
function searchInLayer(layer) {
switch (layer.class())) {
case MSPage:
case MSLayerGroup:
case MSArtboardGroup:
let sublayers = layer.layers()
for (let i = 0; i < sublayers.count(); i++) {
let sublayer = sublayers.objectAtIndex(i);
if(sublayer.class() == 'MSShapeGroup') {
shapeGroups.push(sublayer)
}
searchInLayer(sublayer);
}
break;
}
}
for (let i = 0; i < selection.count(); i++) {
searchInLayer(selection[i], true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment