Created
December 18, 2015 00:17
-
-
Save littlebusters/21fb89bd0742967d841a to your computer and use it in GitHub Desktop.
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 doc = context.document; | |
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