Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noudadrichem/1d9f363b787fbb21a7e00ec273e27105 to your computer and use it in GitHub Desktop.
Save noudadrichem/1d9f363b787fbb21a7e00ec273e27105 to your computer and use it in GitHub Desktop.
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