Skip to content

Instantly share code, notes, and snippets.

@timuric
Last active August 29, 2015 14:02
Show Gist options
  • Save timuric/156ea5cd212d1ff616b0 to your computer and use it in GitHub Desktop.
Save timuric/156ea5cd212d1ff616b0 to your computer and use it in GitHub Desktop.
Export layers in sketch app
function exportLayer(layer,path){
var rect = [layer rectByAccountingForStyleSize:[[layer absoluteRect] rect]];
var slice = [[MSSliceMaker slicesFromExportableLayer:layer inRect:rect] firstObject];
[doc saveArtboardOrSlice: slice toFile: path];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment