Skip to content

Instantly share code, notes, and snippets.

@janily
Created June 16, 2020 11:18
Show Gist options
  • Save janily/4c55e4d5094f6e59ed2abe8239d5e051 to your computer and use it in GitHub Desktop.
Save janily/4c55e4d5094f6e59ed2abe8239d5e051 to your computer and use it in GitHub Desktop.
Select all layers in selected artboard
var sketch = require('sketch')
export default () => {
const doc = sketch.getSelectedDocument()
const selectedArtboard = doc.selectedLayers.layers[0]
function selectChildren(layer) {
layer.selected = true
if (layer.layers) {
layer.layers.forEach(selectChildren)
}
}
selectChildren(selectedArtboard)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment