Created
December 21, 2016 15:21
-
-
Save philsinatra/b0533fb3a7bd5698f2ea283c426ff4c3 to your computer and use it in GitHub Desktop.
The default Custom Plugin script that comes with Sketch
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
log('This is an example Sketch script.'); | |
var documentName = context.document.displayName(); | |
log('The current document is named: ' + documentName); | |
var selectedLayers = context.selection; | |
var selectedCount = selectedLayers.count(); | |
if (selectedCount == 0) { | |
log('No layers are selected.'); | |
} else { | |
log('Selected layers:'); | |
for (var i = 0; i < selectedCount; i++) { | |
var layer = selectedLayers[i]; | |
log((i + 1) + '. ' + layer.name()); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment