Skip to content

Instantly share code, notes, and snippets.

@sonburn
Last active January 8, 2021 03:16
Show Gist options
  • Save sonburn/71e05c03ac02cfe10fea5042215dfacd to your computer and use it in GitHub Desktop.
Save sonburn/71e05c03ac02cfe10fea5042215dfacd to your computer and use it in GitHub Desktop.
Get or set a value on a layer in Sketch
var value = nil,
key = "kModelPropertiesKey",
layer = context.selection[0],
plugin = "com.animaapp.stc-sketch-plugin";
// Get the value
context.command.valueForKey_onLayer_forPluginIdentifier(key,layer,plugin);
// Set the value
context.command.setValue_forKey_onLayer_forPluginIdentifier(value,key,layer,plugin);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment