Created
April 3, 2018 15:04
-
-
Save sonburn/d68688bdbbb96c2e648b6da6ed2afd50 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 layers = context.selection[0].children(), | |
layersLoop = layers.objectEnumerator(), | |
layer, | |
minX = 0, | |
maxX = 1000, | |
minY = 0, | |
maxY = 1000, | |
bounds = NSMakeRect(minX,minY,maxX,maxY); | |
// Deselect the container | |
context.selection[0].select_byExpandingSelection(false,false); | |
// Loop through the container children | |
while (layer = layersLoop.nextObject()) { | |
// If rectangles intersect… | |
if (CGRectIntersectsRect(bounds,layer.absoluteRect().rect())) { | |
// Select the layer | |
layer.select_byExpandingSelection(true,true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment