Created
March 5, 2018 08:32
-
-
Save noudadrichem/1d9f363b787fbb21a7e00ec273e27105 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 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