“Select glyph” dialog via Python?

I’ll see how I can add it to the wrapper. Here is the full code:

GSSelectGlyphsDialogController = objc.lookUpClass("GSSelectGlyphsDialogController")
selectGlyphPanel = GSSelectGlyphsDialogController.alloc().init()
selectGlyphPanel.setTitle_("Find Glyphs")

Master = Font.masters[0] # Pick with master you are interested in, e.g., currentTab.masterIndex
selectGlyphPanel.setMasterID_(Master.id)
selectGlyphPanel.setContent_(list(Font.glyphs))
PreviousSearch = Glyphs.defaults["PickGlyphsSearch"]
if PreviousSearch and len(PreviousSearch) > 0:
	selectGlyphPanel.setSearch_(PreviousSearch)

if selectGlyphPanel.runModal():
	Glyphs.defaults["PickGlyphsSearch"] = selectGlyphPanel.glyphsSelectSearchField().stringValue()
	for glyph in selectGlyphPanel.selectedGlyphs():
		print glyph

3 Likes