I am trying to write a script (based on one of Rainer’s scripts) that will change the nice names of the selected glyphs to production names.
I have tried both:
Font = Glyphs.font selectedGlyphs = [ x.parent for x in Font.selectedLayers ] Font.disableUpdateInterface() for thisGlyph in selectedGlyphs: thisGlyph.name = thisGlyph.productionName Font.enableUpdateInterface()
Font = Glyphs.font selectedGlyphs = [ x.parent for x in Font.selectedLayers ] def ProductionGlyphName( thisGlyph ): oldName = thisGlyph.name newName = thisGlyph.productionName if oldName != newName: thisGlyph.name = newName print "%s --> %s" % (oldName, newName) else: thisGlyph.name = oldName print "%s: unchanged" Font.disableUpdateInterface() for thisGlyph in selectedGlyphs: ProductionGlyphName( thisGlyph ) Font.enableUpdateInterface()
Both are not working. I actually need the script to work on 2.5 (1131). Any ideas?