Export multiple files (script?)

I have a large family in separated .glyphs files (because kerning groups differ). I’d like to export them all at once. Is it possible to script this? Or is there any way to export all open .glyphs files?

1 Like

You don’t even need to open them in Glyphs.

You can use the following methods:

Loop through the directory with the glyphs files and open each in Glyphs:

for filename in os.listdir(directory):
	if filename.endswith(".glyphs") or filename.endswith(".glyphspackage"):
		font = GSFont(directory + filename)

Then export each (active) instance:

for instance in font.instances:
    if instance.active:
        instance.generate()

You can find documentation on how to use instance.generate() in the Glyphs Python API Documentation.

1 Like

Added a checkbox to export all currently open fonts to Export to All Formats script.

2 Likes

Thank you both! I did it with @SCarewe formula so that I don’t have to open the files, but great to know about your script too @alexs