Skip to content

Instantly share code, notes, and snippets.

@abynim
Created September 12, 2019 03:14
Show Gist options
  • Save abynim/70b2af5dd140c75ee7614a41b44b5b7e to your computer and use it in GitHub Desktop.
Save abynim/70b2af5dd140c75ee7614a41b44b5b7e to your computer and use it in GitHub Desktop.
Select filtered layers in Sketch
// run this code in Sketch's script window (Plugins > Run Script...)
// tested in Sketch 57
context.document.currentPage().changeSelectionBySelectingLayers(nil);
let children = context.document.currentPage().children().objectEnumerator(), layer;
while(layer = children.nextObject()) {
layer.select_byExtendingSelection(context.document.sidebarController().filterViewController().filter().shouldIncludeNode(layer), true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment