Skip to content

Commit 7bddd15

Browse files
committed
1.0.3 - use name to find symbols
1 parent 7aa0cef commit 7bddd15

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

images/cover.layer

+3
Large diffs are not rendered by default.

library-symbol-replacer.sketchplugin/Contents/Sketch/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name" : "Library Symbol Replacer",
33
"identifier" : "com.zeroheight.library-symbol-replacer",
4-
"version" : "1.0.2",
4+
"version" : "1.0.3",
55
"description" : "replace local symbols with library symbols",
66
"authorEmail" : "[email protected]",
77
"author" : "zeroheight team",

library-symbol-replacer.sketchplugin/Contents/Sketch/script.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,19 @@ var replaceSymbols = function(context) {
2222
var mySymbols = documentData.localSymbols();
2323
var localLookup = {};
2424
for(var i = 0 ; i < mySymbols.length ; ++i){
25-
var symbolID = String(mySymbols[i].symbolID());
26-
localLookup[symbolID] = mySymbols[i];
25+
var symbolName = String(mySymbols[i].name());
26+
localLookup[symbolName] = mySymbols[i];
2727
}
2828

2929
var imports = [];
3030
var totalInstances = 0;
3131

3232
// find any local symbols in the current document which are now provided by the library
33-
3433
var librarySymbols = library.document().documentData().localSymbols();
3534
for(var i = 0 ; i < librarySymbols.length ; ++i){
3635
var librarySymbol = librarySymbols[i];
37-
var symbolID = String(librarySymbol.symbolID());
38-
var localSymbol = localLookup[symbolID];
36+
var symbolName = String(librarySymbol.name());
37+
var localSymbol = localLookup[symbolName];
3938
if(localSymbol){
4039
var instances = localSymbol.allInstances();
4140
if(instances.length > 0){

0 commit comments

Comments
 (0)