Skip to content

Instantly share code, notes, and snippets.

@nolastan
Created June 1, 2015 23:05
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 nolastan/e684753793095a23a819 to your computer and use it in GitHub Desktop.
Save nolastan/e684753793095a23a819 to your computer and use it in GitHub Desktop.
Sketch.app – apply a shared style
var doc = context.document;
var docLayerStyles = [[doc documentData] layerStyles];
var numObjects = [docLayerStyles numberOfSharedObjects];
var sharedStyle = [docLayerStyles sharedObjectAtIndex: 0];
var layer = context.selection[0];
layer.setStyle(sharedStyle.newInstance());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment