Scripting over glyphs files in a folder

I want to run the script posted here for generating a .gif but instead of over the layers I want to do it over the .glyphs files. Is there a way to get Glyphs app to open .glyphs files by script – and preferrably without needing to open it in the UI every time?

font = GSFont("path/to/file.glyphs")