Created
June 16, 2020 11:18
-
-
Save janily/4c55e4d5094f6e59ed2abe8239d5e051 to your computer and use it in GitHub Desktop.
Select all layers in selected artboard
This file contains hidden or 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 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