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]
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]
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/.
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!