diff --git a/Zeplin.sketchplugin/Contents/Sketch/manifest.json b/Zeplin.sketchplugin/Contents/Sketch/manifest.json index 7283072..3bc6675 100644 --- a/Zeplin.sketchplugin/Contents/Sketch/manifest.json +++ b/Zeplin.sketchplugin/Contents/Sketch/manifest.json @@ -4,7 +4,7 @@ "author": "Zeplin, Inc.", "authorEmail": "dev@zeplin.io", "homepage": "https://zeplin.io", - "version": "1.11", + "version": "1.12", "identifier": "io.zeplin.sketch-plugin", "icon": "Icons/icZeplin.png", "commands": [{ diff --git a/Zeplin.sketchplugin/Contents/Sketch/utils.cocoascript b/Zeplin.sketchplugin/Contents/Sketch/utils.cocoascript index f5c6182..51488e4 100644 --- a/Zeplin.sketchplugin/Contents/Sketch/utils.cocoascript +++ b/Zeplin.sketchplugin/Contents/Sketch/utils.cocoascript @@ -168,6 +168,16 @@ var writeDirectives = function (directives, path) { return path; } +var getShareId = function (context) { + try { + return context.document.cloudShare().shortID(); + } catch (error) { + log("Getting cloud file “shortID” failed with error “" + error + "”.")); + } + + return nil; +} + var launchZeplin = function (context, path) { var doc = context.document; var workspace = [NSWorkspace sharedWorkspace]; @@ -189,6 +199,7 @@ var launchZeplin = function (context, path) { var exportArtboards = function (context, artboards, temporaryPath) { var doc = context.document; + var shareId = getShareId(context); var foreignSymbolsUpToDate = true; // `MSBadgeController` is defined on Sketch 44, `activeWindowBadgingActions` is defined on Sketch 46. @@ -297,6 +308,11 @@ var exportArtboards = function (context, artboards, temporaryPath) { [directives setObject:artboardNamesByIdentifier forKey:@"artboardNames"]; [directives setObject:containsArtboard forKey:@"containsArtboard"]; + if (shareId) { + [directives setObject:shareId forKey:@"shareId"]; + } + + shareId = nil; artboardIds = nil; pageIds = nil; uniqueArtboardSizes = nil;