Skip to content

Instantly share code, notes, and snippets.

@weiweihuanghuang
Created October 26, 2014 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weiweihuanghuang/5575d61938dfdd7f8e2a to your computer and use it in GitHub Desktop.
Save weiweihuanghuang/5575d61938dfdd7f8e2a to your computer and use it in GitHub Desktop.
Find in Layer Names 2
import GlyphsApp
import vanilla
Doc = Glyphs.currentDocument
Font = Glyphs.font
numberOfMasters = len( Font.masters )
text = u""
searchFor = "["
for g in Font.glyphs:
if len( g.layers ) > numberOfMasters:
for Layer in [ x for x in g.layers ][numberOfMasters:]:
if searchFor in Layer.name:
Attributes = {"GSLayerIdAttrib" : Layer.layerId()}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment