Skip to content

Commit

Permalink
fixed tab bar query for newer app versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mekkablue committed Jul 25, 2018
1 parent ca2d1de commit 92991c5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Select/Select Same Layer Color.py
Expand Up @@ -4,18 +4,21 @@
In Font view, select glyphs with the same color(s) as the currently selected one(s).
"""


from AppKit import NSIndexSet

def indexSetWithIndex( index ):
indexSet = NSIndexSet.alloc().initWithIndex_( index )
return indexSet

thisFont = Glyphs.font
thisDoc = Glyphs.currentDocument # frontmost document
fontView = thisDoc.windowController().tabBarControl().viewControllers()[0].glyphsArrayController()
try:
fontView = thisDoc.windowController().tabBarControl().tabItemAtIndex_(0).glyphsArrayController()
except:
fontView = thisDoc.windowController().tabBarControl().viewControllers()[0].glyphsArrayController()
displayedGlyphsInFontView = fontView.arrangedObjects() # all glyphs currently displayed
colorIndexes = []

thisFont = Glyphs.font
if displayedGlyphsInFontView:
displayedIndexRange = range(len(displayedGlyphsInFontView)) # indexes of glyphs in Font view
for i in displayedIndexRange:
Expand Down

0 comments on commit 92991c5

Please sign in to comment.