Scripting variable font export

As part of a bigger script, I’m trying to script export of a variable font but can’t get it to work.

Font.export(VARIABLE)

gives

  File "GlyphsApp/GlyphsApp/__init__.py", line 4279, in __Font_Export__
AttributeError: 'GlyphsFileFormatVariationFonts' object has no attribute 'writeVARTables_error_'

while

instance.generate(Format=VARIABLE)

gives

  File "GlyphsApp/GlyphsApp/__init__.py", line 4222, in __Instance_Export__
KeyError: "The font format is not supported: variable (only 'OTF' and 'TTF')"

Using instance.generate() for other formats, I can control export path, etc. which is essential for the use of this script.

Variable font export from the normal Export dialog works fine.

Thankful for any help,
Erik

I fixed that.

1 Like