Script to generate instances doesn't work anymore

Hello

I used to work with the script below on a regular basis, it worked perfectly well until recently. I haven’t changed anything in the code, would you have an idea of what might go wrong? I get the notification that the font has been successfully exported, but I don’t have any file in the Fonts folder… All users are allowed to read and write the Indesign Fonts folder.

Thank you in advance

#MenuTitle: Export with date
# -*- coding: utf-8 -*-

from time import sleep
from datetime import datetime

f = Glyphs.font

d = datetime.now()
date = d.strftime('%y%m%d')

all_instances = f.instances
exportFolder = '/Applications/Adobe InDesign 2024/Fonts'

for instance in all_instances:
	instance.name = instance.name + "-" + date  
	instance.generate(FontPath = exportFolder, AutoHint = True, RemoveOverlap = True , UseProductionNames = True )
	Glyphs.showNotification('Export fonts', 'The export of %s was successful.' % (Glyphs.font.familyName))		
	instance.name = instance.name[:-7]

The argument keys were updated to camelCase: Bug: generate TTF generates OTF - #3 by GeorgSeifert

According to this comment, though, the old Title case should still work.

Try changing FontPath, AutoHint etc. to fontPath, autoHint etc.

Hi Sebastian

Thanks, I just tried, but it still doesn’t work. Is there any way to get a more detailed report of the export?

Do you get any error message?

No error message, the notification reads that the export is successful, but no file is exported.

Here is the tweaked code with lowercases, in case I missed something.

#MenuTitle: Export with date
# -*- coding: utf-8 -*-

from time import sleep
from datetime import datetime

f = Glyphs.font

d = datetime.now()
date = d.strftime('%y%m%d')

all_instances = f.instances
exportFolder = 'Applications/Adobe InDesign 2024/Fonts'

for instance in all_instances:
	instance.name = instance.name + "-" + date  
	instance.generate(fontPath = exportFolder, autoHint = True, removeOverlap = True , useProductionNames = True, format = OTF )
	Glyphs.showNotification('Export fonts', 'The export of %s was successful.' % (Glyphs.font.familyName))		
	instance.name = instance.name[:-7]

You need to use a str for the format argument. So try using format="OTF"

Ok thank you, just changed it but it doesn’t solve the issue.

that is not true. You just need to do:

from GlyphsApp import OTF, TTF

Make sure that you don’t miss the / at the beginning of the path. And for me, that Folder is write protected. I would recommend using /Library/Application Support/Adobe/Fonts/.

Maybe an Indesign update has replaced the Fonts folder and reset write permissions.

Ok it works now, I think the issue was the capitalisation. Also one glyph couldn’t pass the auto hint process, it returned an error when exporting manually, but not in the console of the script. Thank you for your help!