Rename a glyph via scripting

How do I rename a glyph via scripting.

I want to append “.liga” to the current open glyph or selected glyphs.


You don’t need to script that; it’s something you can do by default. Select glyphs, open Search and Replace (shift-command-F). You empty the search field which indicates that you want to add stuff at the end, and type ‘.liga’ in the replace field.

@Tosche Thanks for the reply.

I’m aware of Search and Replace functionality.
Would like to learn the scripting way of doing it as well.


In that case, here’s the code:

for l in Glyphs.font.selectedLayers: += '.liga'

Thank you very much for the answer.