So I want to perform some operations on a font, then revert the entire font and reopen. I have a short script that seems to do what I want…
font = Glyphs.font
myPath = font.filepath
#DO SOME FUN STUFF
font.close([True])
Glyphs.open(myPath)
font = Glyphs.font
#Do more stuff…
However, even though the font opens correctly in the viewer, I am getting a traceback…
Traceback (most recent call last):
File “AlignComponents.py”, line 34, in
Glyphs.open(myPath)
File “/Users/georg/Programmierung/Glyphs/Glyphs/Glyphs/Scripts/GlyphsApp.py”, line 291, in OpenFont
AttributeError: ‘tuple’ object has no attribute ‘font’
and the “more stuff” doesn’t happen, apparently because the font object can’t be read or manipulated further after that traceback.