Skip to content

Instantly share code, notes, and snippets.

@uhunkler
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uhunkler/9427584 to your computer and use it in GitHub Desktop.
Save uhunkler/9427584 to your computer and use it in GitHub Desktop.
Empty selection bug - Sketch 2.4.3 - OS X 10.9.2
doc.showMessage('sel: ' + selection.length());
log(selection.length());
for (var i = 0; i < selection.length(); i++)
{
var layer = selection[i];
log(layer);
}
@uhunkler
Copy link
Author

uhunkler commented Mar 8, 2014

When the script is run with a new opened document and no selection selection.length() should return 0. Instead the script does not run and no log messages are created. When I then select a layer the script works correct. And after deselecting the layer again the scripts logs 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment