From 62a2b1cb9671aaef102e30b90568bf0f719c4c57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20Ak=C4=B1?= Date: Wed, 23 Feb 2022 20:55:32 +0300 Subject: [PATCH 1/2] Collect `shareId` for cloud documents --- .../Contents/Sketch/utils.cocoascript | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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; From dc5f0b3227d82eeb2f9416300af9801c42ea0100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2EG=C3=B6kay=20Borulday?= Date: Mon, 14 Mar 2022 19:13:33 +0300 Subject: [PATCH 2/2] Bump version --- Zeplin.sketchplugin/Contents/Sketch/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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": [{