Skip to content

Commit

Permalink
Add support for layers inside symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
margusholland committed Feb 19, 2017
1 parent 56557cd commit b8706d4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Comma.sketchplugin/Contents/Sketch/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"title": "Comma"
},
"identifier": "com.margusholland.commafucker",
"version": "1.1.3",
"version": "1.2",
"description": "Set of commands to clean up and modify text layers.",
"authorEmail": "margusholland@me.com",
"name": "Comma",
Expand Down
6 changes: 4 additions & 2 deletions Comma.sketchplugin/Contents/Sketch/script.cocoascript
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ var layers = function(context) {
if (selectedGroups.count() > 0) {
return selectedGroups
} else {
[doc showMessage:'Nothing selected']
return [NSArray new]
[doc showMessage:'Nothing selected']
return [NSArray new]
}
} else {
return selectedLayersOfClass(MSTextLayer, context)
Expand All @@ -41,6 +41,8 @@ var flatten = function(array) {
var item = [array objectAtIndex:i]
if (([item class] == MSLayerGroup || [item class] == MSArtboardGroup) && item.layers().count() > 0) {
[flatArray addObjectsFromArray:flatten(item.layers())]
} else if ([item class] == MSSymbolInstance && item.symbolMaster().layers().count() > 0) {
[flatArray addObjectsFromArray:flatten(item.symbolMaster().layers())]
} else {
if ([item class] == MSTextLayer) {
[flatArray addObject:item]
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Select text layers, layer groups or artboards to change the text. Following comm

# Change log

## v.1.2 (Symbols)
* Support for text layers inside symbols, updates the symbol master when an instance is selected

## v.1.1.3 (Sketch 42 compatibility)
* Fixes issues with Sketch 42
NB! Might not be backwards compatible, don’t have any earlier version to test on
Expand Down

0 comments on commit b8706d4

Please sign in to comment.