Skip to content

Instantly share code, notes, and snippets.

@okay-type
Created January 6, 2024 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okay-type/64f4579bee049d7fd8ddf019070e5d3b to your computer and use it in GitHub Desktop.
Save okay-type/64f4579bee049d7fd8ddf019070e5d3b to your computer and use it in GitHub Desktop.
Open Robofont scripting windows with preset code
from mojo.subscriber import Subscriber, registerRoboFontSubscriber
# set as a startup script
# open new scripting windows with preset code
# requires Robofont beta 2401051907 (5 January 2024) or later
# ok@ytyt.pe
preset = '''# a = AllFonts()
# f = CurrentFont()
# g = CurrentGlyph()
'''
class initial_script_placeholder(Subscriber):
debug = False
def scriptingWindowDidOpen(self, info):
info['window'].setText(preset)
registerRoboFontSubscriber(initial_script_placeholder)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment