The way I'm doing it right now is inefficient:
To streamline things I'll need to stop using the usual settings file and instead load/save an app-specific settings file in on.load_settings and on.save_settings respectively.
VY24DRY6CZGUUURGPIYSL63HYTE22D573G5UX4MN55JORJ5GNW6AC L2HMMGZPLQTMRPSHKIZZA77KOKKNVREUOWNSUKTIMS2GPMLJL4BAC JIBCAKTUIYZ2NAAOXJ7YBM72XG7FZA2AQL64MZBJVM62ELU2BO4AC LRDM35CEK3OHXOTB7TEFJRL7P6PQWO5ZG3F2BVA7DIDFHBPJQ7KAC FS2ITYYHBLFT66YUC3ENPFYI2HOYHOVEPQIN7NQR6KF5MEK4NKZAC D4FEFHQCSILZFQ5VLWNXAIRZNUMCDNGJSM4UJ6T6FDMMIWYRYILQC R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC things will happen if you have _more than_ a single such app running.)
things will happen if you have _more than_ a single such app running. Or ifyou close one app and open another without restarting the driver. Just alwaysopen the app and then the driver. If you close the app, close the driver.)
{"on_handle":547,"text_input_on_manifest_navigator":634,"new_definition":681,"manifest_coord":636,"on_text":539,"on.mouse_press":617,"font":353,"add_thick_line":400,"A":507,"sx":544,"vx":545,"B":379,"on.key_release":552,"on":1,"mouse_cursor":558,"Mouse_cursor":559,"add_def_to_menu":640,"set_mouse_cursor":562,"Surface":422,"box_height":680,"compute_layout":385,"on.code_change":306,"order_of_magnitude":573,"approximate":579,"tick_spec":660,"update_editor_box":570,"approximate_up":658,"Ticks_font":669,"vy":546,"schema1_of_y":667,"Page":475,"on.save_settings":702,"on.load_settings":700,"scale":7,"initialize_editor":678,"Cursor_node":172,"table_and_array_both_empty":689,"manifest_index":637,"sy":469,"Menu_background_color":611,"line_height":365,"Menu_border_color":612,"manifest_navigator_candidates":638,"Menu_command_color":613,"on.keychord_press":666,"Menu_highlight_color":614,"on.initialize":695,"draw_menu_bar":641,"num_lines_for_manifest_navigator":676,"add_hotkey_to_menu":616,"Manifest_navigator":495,"draw_cursor":639,"draw_manifest_navigator":677,"fw_parent":705,"y_of_schema1":364,"fw_app":"driver","on.update":561,"reset_manifest_navigator":621,"Definitions":503,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"on.draw":565,"get_definition_from_app":624,"load_definition":682,"copy_shape":396,"Manifest":494,"Viewport":604,"manifest_navigator_up":628,"load_manifest":694,"manifest_navigator_down":635,"get_manifest":706,"draw_ticks":663,"delete_definition":673,"on.text_input":521,"move_candidate_to_front_of_manifest":632,"on.mouse_release":554,"keychord_press_on_manifest_navigator":675}
get_manifest = function()live.send_to_app('MANIFEST')local response_stringrepeatlove.timer.sleep(0.01)response_string = live.receive_from_app()until response_stringlocal result = {}if #response_string == 0 then-- error; retryreturn resultelse-- stop retryingManifest_navigator.reload = falseendlocal app_namelocal response = json.decode(response_string)for name, value in pairs(response) doif not starts_with(name, 'fw_') thentable.insert(result, name)elseif name == 'fw_app' thenapp_name = valueendendreturn result, app_nameend
{"manifest_navigator_candidates":638,"add_def_to_menu":640,"draw_cursor":639,"Manifest":494,"load_manifest":694,"get_manifest":705,"Definitions":503,"tick_spec":660,"new_definition":681,"update_editor_box":570,"load_definition":682,"maybe_update_key_in_definitions":529,"fw_parent":704,"fw_app":"driver","box_height":680,"schema1_of_y":667,"on.save_settings":702,"on.load_settings":700,"y_of_schema1":364,"on_handle":547,"Surface":422,"font":353,"on.mouse_press":617,"on.draw":565,"sx":544,"vx":545,"Viewport":604,"compute_layout":385,"vy":546,"on":1,"on.key_release":552,"Menu_background_color":611,"on.mouse_release":554,"Menu_border_color":612,"on.update":561,"Menu_command_color":613,"mouse_cursor":558,"copy_shape":396,"Mouse_cursor":559,"Cursor_node":172,"initialize_editor":678,"add_hotkey_to_menu":616,"set_mouse_cursor":562,"draw_menu_bar":641,"draw_ticks":663,"draw_manifest_navigator":677,"num_lines_for_manifest_navigator":676,"B":379,"scale":7,"reset_manifest_navigator":621,"Menu_highlight_color":614,"on_text":539,"load_from_iterator":670,"order_of_magnitude":573,"get_definition_from_app":624,"on.initialize":695,"Manifest_navigator":495,"table_and_array_both_empty":689,"approximate":579,"manifest_navigator_up":628,"sy":469,"manifest_navigator_down":635,"on.keychord_press":666,"line_height":365,"delete_definition":673,"A":507,"move_candidate_to_front_of_manifest":632,"approximate_up":658,"keychord_press_on_manifest_navigator":675,"Page":475,"text_input_on_manifest_navigator":634,"on.code_change":306,"Ticks_font":669,"manifest_coord":636,"on.text_input":521,"manifest_index":637,"add_thick_line":400}
get_manifest = function()live.send_to_app('MANIFEST')local response_stringrepeatlove.timer.sleep(0.01)response_string = live.receive_from_app()until response_stringlocal result = {}if #response_string == 0 then-- error; retryreturn resultelse-- stop retryingManifest_navigator.reload = falseendlocal app_namelocal response = json.decode(response_string)for name, value in pairs(response) doif not starts_with(name, 'fw_') thentable.insert(result, name)elseif name == 'fw_app' thenprint('get manifest: app_name', value)app_name = valueendendreturn result, app_nameend
{"maybe_update_key_in_definitions":529,"load_from_iterator":670,"schema1_of_y":667,"get_definition_from_app":624,"sy":469,"manifest_navigator_up":628,"manifest_navigator_down":635,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"on_handle":547,"Manifest_navigator":495,"initialize_editor":678,"on.initialize":695,"on_text":539,"manifest_index":637,"manifest_navigator_candidates":638,"on.update":561,"add_def_to_menu":640,"vx":545,"Manifest":494,"on.mouse_release":554,"load_manifest":694,"on.key_release":552,"get_manifest":704,"Definitions":503,"mouse_cursor":558,"new_definition":681,"compute_layout":385,"Cursor_node":172,"on.code_change":306,"set_mouse_cursor":562,"draw_ticks":663,"vy":546,"on.mouse_press":617,"order_of_magnitude":573,"load_definition":682,"on.keychord_press":666,"approximate":579,"Page":475,"A":507,"on.save_settings":702,"on.load_settings":700,"add_thick_line":400,"Ticks_font":669,"table_and_array_both_empty":689,"draw_cursor":639,"Viewport":604,"scale":7,"text_input_on_manifest_navigator":634,"sx":544,"approximate_up":658,"on.text_input":521,"font":353,"copy_shape":396,"line_height":365,"y_of_schema1":364,"box_height":680,"Surface":422,"Menu_background_color":611,"keychord_press_on_manifest_navigator":675,"Menu_border_color":612,"on.draw":565,"Menu_command_color":613,"update_editor_box":570,"Menu_highlight_color":614,"tick_spec":660,"draw_menu_bar":641,"Mouse_cursor":559,"add_hotkey_to_menu":616,"manifest_coord":636,"B":379,"draw_manifest_navigator":677,"on":1,"num_lines_for_manifest_navigator":676,"fw_app":"driver","fw_parent":703,"reset_manifest_navigator":621}
get_manifest = function()live.send_to_app('MANIFEST')local response_stringrepeatlove.timer.sleep(0.01)response_string = live.receive_from_app()until response_stringlocal result = {}if #response_string == 0 then-- error; retryreturn resultelse-- stop retryingManifest_navigator.reload = falseendlocal app_namelocal response = json.decode(response_string)for name, value in pairs(response) doif not starts_with(name, 'fw_') thentable.insert(result, name)elseif name == 'fw_app' thenapp_name = valueendendreturn result, app_nameend
{"table_and_array_both_empty":689,"Ticks_font":669,"on.initialize":695,"B":379,"get_manifest":703,"load_manifest":694,"on.keychord_press":666,"on_handle":547,"on_text":539,"Surface":422,"vx":545,"vy":546,"Menu_background_color":611,"on.mouse_release":554,"Menu_border_color":612,"on.update":561,"Menu_command_color":613,"Page":475,"draw_menu_bar":641,"add_hotkey_to_menu":616,"on.mouse_press":617,"mouse_cursor":558,"draw_manifest_navigator":677,"Mouse_cursor":559,"num_lines_for_manifest_navigator":676,"set_mouse_cursor":562,"load_from_iterator":670,"update_editor_box":570,"get_definition_from_app":624,"manifest_navigator_down":635,"delete_definition":673,"manifest_navigator_up":628,"move_candidate_to_front_of_manifest":632,"scale":7,"keychord_press_on_manifest_navigator":675,"text_input_on_manifest_navigator":634,"manifest_coord":636,"manifest_index":637,"manifest_navigator_candidates":638,"on.draw":565,"sy":469,"add_def_to_menu":640,"Viewport":604,"draw_cursor":639,"Manifest_navigator":495,"fw_parent":702,"tick_spec":660,"fw_app":"driver","line_height":365,"on":1,"Manifest":494,"schema1_of_y":667,"draw_ticks":663,"new_definition":681,"maybe_update_key_in_definitions":529,"Definitions":503,"reset_manifest_navigator":621,"load_definition":682,"on.save_settings":702,"order_of_magnitude":573,"box_height":680,"compute_layout":385,"initialize_editor":678,"Cursor_node":172,"approximate":579,"add_thick_line":400,"y_of_schema1":364,"copy_shape":396,"font":353,"on.text_input":521,"on.code_change":306,"on.load_settings":700,"A":507,"approximate_up":658,"on.key_release":552,"sx":544,"Menu_highlight_color":614}
get_manifest = function()live.send_to_app('MANIFEST')local response_stringrepeatlove.timer.sleep(0.01)response_string = live.receive_from_app()until response_stringlocal result = {}if #response_string == 0 then-- error; retryreturn resultelse-- stop retryingManifest_navigator.reload = falseendlocal app_namelocal response = json.decode(response_string)for name, value in pairs(response) doif not starts_with(name, 'fw_') thentable.insert(result, name)elseif name == 'fw_app' thenprint('get manifest: app_name', value)app_name = valueendendreturn result, append
on.save_settings = function()if Settings == nil thenSettings = {} -- just for initial schema migrationendfor key,node in pairs(Definitions) doif type(key) == 'number' then-- can't save the array side for now because of a limitation in theDefinitions[key] = nilelsenode.data = nil -- don't save uncommitted data for nownode.editor = nil -- TODO: check for hierarchyendendSettings[App_name] = {viewport=Viewport,definitions=Definitions,}return Settingsend
{"on.save_settings":702,"on.load_settings":700,"manifest_navigator_down":635,"delete_definition":673,"table_and_array_both_empty":689,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"box_height":680,"text_input_on_manifest_navigator":634,"compute_layout":385,"manifest_coord":636,"on.code_change":306,"manifest_index":637,"on.mouse_press":617,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"vx":545,"on.key_release":552,"draw_cursor":639,"initialize_editor":678,"font":353,"update_editor_box":570,"mouse_cursor":558,"Mouse_cursor":559,"set_mouse_cursor":562,"draw_ticks":663,"line_height":365,"add_thick_line":400,"copy_shape":396,"order_of_magnitude":573,"on.mouse_release":554,"approximate":579,"approximate_up":658,"scale":7,"Ticks_font":669,"on.initialize":695,"A":507,"Surface":422,"fw_app":"driver","on.text_input":521,"on.draw":565,"Cursor_node":172,"Manifest":494,"fw_parent":701,"Viewport":604,"load_manifest":694,"y_of_schema1":364,"get_manifest":693,"on_text":539,"on_handle":547,"schema1_of_y":667,"Menu_background_color":611,"tick_spec":660,"Menu_border_color":612,"Definitions":503,"Menu_command_color":613,"on.update":561,"Menu_highlight_color":614,"on.keychord_press":666,"draw_menu_bar":641,"vy":546,"add_hotkey_to_menu":616,"Page":475,"on":1,"draw_manifest_navigator":677,"new_definition":681,"num_lines_for_manifest_navigator":676,"load_definition":682,"sy":469,"reset_manifest_navigator":621,"manifest_navigator_up":628,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"B":379,"get_definition_from_app":624,"Manifest_navigator":495}
on.save_settings = function()if Settings == nil thenSettings = {}endfor key,node in pairs(Definitions) doif type(key) == 'number' then-- can't save the array side for now because of a limitation in theDefinitions[key] = nilelsenode.data = nil -- don't save uncommitted data for nownode.editor = nil -- TODO: check for hierarchyendendSettings[App_name] = {viewport=Viewport,definitions=Definitions,}return Settingsend
{"on.save_settings":701,"on.load_settings":700,"manifest_navigator_down":635,"delete_definition":673,"table_and_array_both_empty":689,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"box_height":680,"text_input_on_manifest_navigator":634,"compute_layout":385,"manifest_coord":636,"on.code_change":306,"manifest_index":637,"on.mouse_press":617,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"vx":545,"on.key_release":552,"draw_cursor":639,"initialize_editor":678,"font":353,"update_editor_box":570,"mouse_cursor":558,"Mouse_cursor":559,"set_mouse_cursor":562,"draw_ticks":663,"line_height":365,"add_thick_line":400,"copy_shape":396,"order_of_magnitude":573,"on.mouse_release":554,"approximate":579,"approximate_up":658,"scale":7,"Ticks_font":669,"on.initialize":695,"A":507,"Surface":422,"fw_app":"driver","on.text_input":521,"on.draw":565,"Cursor_node":172,"Manifest":494,"fw_parent":700,"Viewport":604,"load_manifest":694,"y_of_schema1":364,"get_manifest":693,"on_text":539,"on_handle":547,"schema1_of_y":667,"Menu_background_color":611,"tick_spec":660,"Menu_border_color":612,"Definitions":503,"Menu_command_color":613,"on.update":561,"Menu_highlight_color":614,"on.keychord_press":666,"draw_menu_bar":641,"vy":546,"add_hotkey_to_menu":616,"Page":475,"on":1,"draw_manifest_navigator":677,"new_definition":681,"num_lines_for_manifest_navigator":676,"load_definition":682,"sy":469,"reset_manifest_navigator":621,"manifest_navigator_up":628,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"B":379,"get_definition_from_app":624,"Manifest_navigator":495}
on.load_settings = function(settings)App_name = load_manifest()print('app name', App_name, settings)if settings == nil then return endSettings = settings -- stash all settings into a global for on.save_settingsif settings[App_name] == nil thenreturnendViewport = settings[App_name].viewportDefinitions = settings[App_name].definitionsfor name, def in pairs(Definitions) dodef.data = load_from_iterator(get_definition_from_app(name):gmatch("[^\r\n]+"))endend
{"on.save_settings":687,"on.load_settings":700,"manifest_navigator_down":635,"delete_definition":673,"table_and_array_both_empty":689,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"box_height":680,"text_input_on_manifest_navigator":634,"compute_layout":385,"manifest_coord":636,"on.code_change":306,"manifest_index":637,"on.mouse_press":617,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"vx":545,"on.key_release":552,"draw_cursor":639,"initialize_editor":678,"font":353,"update_editor_box":570,"mouse_cursor":558,"Mouse_cursor":559,"set_mouse_cursor":562,"draw_ticks":663,"line_height":365,"add_thick_line":400,"copy_shape":396,"order_of_magnitude":573,"on.mouse_release":554,"approximate":579,"approximate_up":658,"scale":7,"Ticks_font":669,"on.initialize":695,"A":507,"Surface":422,"fw_app":"driver","on.text_input":521,"on.draw":565,"Cursor_node":172,"Manifest":494,"fw_parent":699,"Viewport":604,"load_manifest":694,"y_of_schema1":364,"get_manifest":693,"on_text":539,"on_handle":547,"schema1_of_y":667,"Menu_background_color":611,"tick_spec":660,"Menu_border_color":612,"Definitions":503,"Menu_command_color":613,"on.update":561,"Menu_highlight_color":614,"on.keychord_press":666,"draw_menu_bar":641,"vy":546,"add_hotkey_to_menu":616,"Page":475,"on":1,"draw_manifest_navigator":677,"new_definition":681,"num_lines_for_manifest_navigator":676,"load_definition":682,"sy":469,"reset_manifest_navigator":621,"manifest_navigator_up":628,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"B":379,"get_definition_from_app":624,"Manifest_navigator":495}
on.load_settings = function(settings)App_name = load_manifest()Viewport = settings[App_name].viewportDefinitions = settings[App_name].definitionsfor name, def in pairs(Definitions) dodef.data = load_from_iterator(get_definition_from_app(name):gmatch("[^\r\n]+"))endend
{"on.save_settings":687,"on.load_settings":699,"manifest_navigator_down":635,"delete_definition":673,"table_and_array_both_empty":689,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"box_height":680,"text_input_on_manifest_navigator":634,"compute_layout":385,"manifest_coord":636,"on.code_change":306,"manifest_index":637,"on.mouse_press":617,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"vx":545,"on.key_release":552,"draw_cursor":639,"initialize_editor":678,"font":353,"update_editor_box":570,"mouse_cursor":558,"Mouse_cursor":559,"set_mouse_cursor":562,"draw_ticks":663,"line_height":365,"add_thick_line":400,"copy_shape":396,"order_of_magnitude":573,"on.mouse_release":554,"approximate":579,"approximate_up":658,"scale":7,"Ticks_font":669,"on.initialize":695,"A":507,"Surface":422,"fw_app":"driver","on.text_input":521,"on.draw":565,"Cursor_node":172,"Manifest":494,"fw_parent":698,"Viewport":604,"load_manifest":694,"y_of_schema1":364,"get_manifest":693,"on_text":539,"on_handle":547,"schema1_of_y":667,"Menu_background_color":611,"tick_spec":660,"Menu_border_color":612,"Definitions":503,"Menu_command_color":613,"on.update":561,"Menu_highlight_color":614,"on.keychord_press":666,"draw_menu_bar":641,"vy":546,"add_hotkey_to_menu":616,"Page":475,"on":1,"draw_manifest_navigator":677,"new_definition":681,"num_lines_for_manifest_navigator":676,"load_definition":682,"sy":469,"reset_manifest_navigator":621,"manifest_navigator_up":628,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"B":379,"get_definition_from_app":624,"Manifest_navigator":495}
on.load_settings = function(settings)App_name = load_manifest()Viewport = settings[app_name].viewportDefinitions = settings[app_name].definitionsfor name, def in pairs(Definitions) dodef.data = load_from_iterator(get_definition_from_app(name):gmatch("[^\r\n]+"))endend
{"on.save_settings":687,"on.load_settings":698,"manifest_navigator_down":635,"delete_definition":673,"table_and_array_both_empty":689,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"box_height":680,"text_input_on_manifest_navigator":634,"compute_layout":385,"manifest_coord":636,"on.code_change":306,"manifest_index":637,"on.mouse_press":617,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"vx":545,"on.key_release":552,"draw_cursor":639,"initialize_editor":678,"font":353,"update_editor_box":570,"mouse_cursor":558,"Mouse_cursor":559,"set_mouse_cursor":562,"draw_ticks":663,"line_height":365,"add_thick_line":400,"copy_shape":396,"order_of_magnitude":573,"on.mouse_release":554,"approximate":579,"approximate_up":658,"scale":7,"Ticks_font":669,"on.initialize":695,"A":507,"Surface":422,"fw_app":"driver","on.text_input":521,"on.draw":565,"Cursor_node":172,"Manifest":494,"fw_parent":697,"Viewport":604,"load_manifest":694,"y_of_schema1":364,"get_manifest":693,"on_text":539,"on_handle":547,"schema1_of_y":667,"Menu_background_color":611,"tick_spec":660,"Menu_border_color":612,"Definitions":503,"Menu_command_color":613,"on.update":561,"Menu_highlight_color":614,"on.keychord_press":666,"draw_menu_bar":641,"vy":546,"add_hotkey_to_menu":616,"Page":475,"on":1,"draw_manifest_navigator":677,"new_definition":681,"num_lines_for_manifest_navigator":676,"load_definition":682,"sy":469,"reset_manifest_navigator":621,"manifest_navigator_up":628,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"B":379,"get_definition_from_app":624,"Manifest_navigator":495}
on.load_settings = function(settings)local app_name = load_manifest()Viewport = settings[app_name].viewportDefinitions = settings[app_name].definitionsfor name, def in pairs(Definitions) dodef.data = load_from_iterator(get_definition_from_app(name):gmatch("[^\r\n]+"))endend
{"on.save_settings":687,"on.load_settings":697,"manifest_navigator_down":635,"delete_definition":673,"table_and_array_both_empty":689,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"box_height":680,"text_input_on_manifest_navigator":634,"compute_layout":385,"manifest_coord":636,"on.code_change":306,"manifest_index":637,"on.mouse_press":617,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"vx":545,"on.key_release":552,"draw_cursor":639,"initialize_editor":678,"font":353,"update_editor_box":570,"mouse_cursor":558,"Mouse_cursor":559,"set_mouse_cursor":562,"draw_ticks":663,"line_height":365,"add_thick_line":400,"copy_shape":396,"order_of_magnitude":573,"on.mouse_release":554,"approximate":579,"approximate_up":658,"scale":7,"Ticks_font":669,"on.initialize":695,"A":507,"Surface":422,"fw_app":"driver","on.text_input":521,"on.draw":565,"Cursor_node":172,"Manifest":494,"fw_parent":696,"Viewport":604,"load_manifest":694,"y_of_schema1":364,"get_manifest":693,"on_text":539,"on_handle":547,"schema1_of_y":667,"Menu_background_color":611,"tick_spec":660,"Menu_border_color":612,"Definitions":503,"Menu_command_color":613,"on.update":561,"Menu_highlight_color":614,"on.keychord_press":666,"draw_menu_bar":641,"vy":546,"add_hotkey_to_menu":616,"Page":475,"on":1,"draw_manifest_navigator":677,"new_definition":681,"num_lines_for_manifest_navigator":676,"load_definition":682,"sy":469,"reset_manifest_navigator":621,"manifest_navigator_up":628,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"B":379,"get_definition_from_app":624,"Manifest_navigator":495}
on.load_settings = function(settings)local app_name = load_manifest()Viewport = settings.viewportDefinitions = settings.definitionsfor name, def in pairs(Definitions) dodef.data = load_from_iterator(get_definition_from_app(name):gmatch("[^\r\n]+"))endend
{"on.save_settings":687,"on.load_settings":696,"manifest_navigator_down":635,"delete_definition":673,"table_and_array_both_empty":689,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"box_height":680,"text_input_on_manifest_navigator":634,"compute_layout":385,"manifest_coord":636,"on.code_change":306,"manifest_index":637,"on.mouse_press":617,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"vx":545,"on.key_release":552,"draw_cursor":639,"initialize_editor":678,"font":353,"update_editor_box":570,"mouse_cursor":558,"Mouse_cursor":559,"set_mouse_cursor":562,"draw_ticks":663,"line_height":365,"add_thick_line":400,"copy_shape":396,"order_of_magnitude":573,"on.mouse_release":554,"approximate":579,"approximate_up":658,"scale":7,"Ticks_font":669,"on.initialize":695,"A":507,"Surface":422,"fw_app":"driver","on.text_input":521,"on.draw":565,"Cursor_node":172,"Manifest":494,"fw_parent":695,"Viewport":604,"load_manifest":694,"y_of_schema1":364,"get_manifest":693,"on_text":539,"on_handle":547,"schema1_of_y":667,"Menu_background_color":611,"tick_spec":660,"Menu_border_color":612,"Definitions":503,"Menu_command_color":613,"on.update":561,"Menu_highlight_color":614,"on.keychord_press":666,"draw_menu_bar":641,"vy":546,"add_hotkey_to_menu":616,"Page":475,"on":1,"draw_manifest_navigator":677,"new_definition":681,"num_lines_for_manifest_navigator":676,"load_definition":682,"sy":469,"reset_manifest_navigator":621,"manifest_navigator_up":628,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"B":379,"get_definition_from_app":624,"Manifest_navigator":495}
on.initialize = function()if table_and_array_both_empty(Definitions) thennew_definition()endA()end
{"on.save_settings":687,"on.load_settings":688,"manifest_navigator_down":635,"delete_definition":673,"table_and_array_both_empty":689,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"box_height":680,"text_input_on_manifest_navigator":634,"compute_layout":385,"manifest_coord":636,"on.code_change":306,"manifest_index":637,"on.mouse_press":617,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"vx":545,"on.key_release":552,"draw_cursor":639,"initialize_editor":678,"font":353,"update_editor_box":570,"mouse_cursor":558,"Mouse_cursor":559,"set_mouse_cursor":562,"draw_ticks":663,"line_height":365,"add_thick_line":400,"copy_shape":396,"order_of_magnitude":573,"on.mouse_release":554,"approximate":579,"approximate_up":658,"scale":7,"Ticks_font":669,"on.initialize":695,"A":507,"Surface":422,"fw_app":"driver","on.text_input":521,"on.draw":565,"Cursor_node":172,"Manifest":494,"fw_parent":694,"Viewport":604,"load_manifest":694,"y_of_schema1":364,"get_manifest":693,"on_text":539,"on_handle":547,"schema1_of_y":667,"Menu_background_color":611,"tick_spec":660,"Menu_border_color":612,"Definitions":503,"Menu_command_color":613,"on.update":561,"Menu_highlight_color":614,"on.keychord_press":666,"draw_menu_bar":641,"vy":546,"add_hotkey_to_menu":616,"Page":475,"on":1,"draw_manifest_navigator":677,"new_definition":681,"num_lines_for_manifest_navigator":676,"load_definition":682,"sy":469,"reset_manifest_navigator":621,"manifest_navigator_up":628,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"B":379,"get_definition_from_app":624,"Manifest_navigator":495}
{"on.save_settings":687,"on.load_settings":688,"manifest_navigator_down":635,"delete_definition":673,"table_and_array_both_empty":689,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"box_height":680,"text_input_on_manifest_navigator":634,"compute_layout":385,"manifest_coord":636,"on.code_change":306,"manifest_index":637,"on.mouse_press":617,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"vx":545,"on.key_release":552,"draw_cursor":639,"initialize_editor":678,"font":353,"update_editor_box":570,"mouse_cursor":558,"Mouse_cursor":559,"set_mouse_cursor":562,"draw_ticks":663,"line_height":365,"add_thick_line":400,"copy_shape":396,"order_of_magnitude":573,"on.mouse_release":554,"approximate":579,"approximate_up":658,"scale":7,"Ticks_font":669,"on.initialize":692,"A":507,"Surface":422,"fw_app":"driver","on.text_input":521,"on.draw":565,"Cursor_node":172,"Manifest":494,"fw_parent":693,"Viewport":604,"load_manifest":694,"y_of_schema1":364,"get_manifest":693,"on_text":539,"on_handle":547,"schema1_of_y":667,"Menu_background_color":611,"tick_spec":660,"Menu_border_color":612,"Definitions":503,"Menu_command_color":613,"on.update":561,"Menu_highlight_color":614,"on.keychord_press":666,"draw_menu_bar":641,"vy":546,"add_hotkey_to_menu":616,"Page":475,"on":1,"draw_manifest_navigator":677,"new_definition":681,"num_lines_for_manifest_navigator":676,"load_definition":682,"sy":469,"reset_manifest_navigator":621,"manifest_navigator_up":628,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"B":379,"get_definition_from_app":624,"Manifest_navigator":495}
load_manifest = function()-- Connect to an app and load its manifest into global Manifest.-- Also return the name of the app we have connected to.local new_manifest, app_name = get_manifest()-- preserve existing order-- 1. add new definitions in frontfor _,name in ipairs(new_manifest) doif not array.find(Manifest, name) thentable.insert(Manifest, 1, name)endend-- 2. remove missing definitionsfor idx=#Manifest,1,-1 dolocal name = Manifest[idx]if not array.find(new_manifest, name) thentable.remove(Manifest, idx)endendreturn app_nameend
{"on.save_settings":687,"on.load_settings":688,"manifest_navigator_down":635,"delete_definition":673,"table_and_array_both_empty":689,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"box_height":680,"text_input_on_manifest_navigator":634,"compute_layout":385,"manifest_coord":636,"on.code_change":306,"manifest_index":637,"on.mouse_press":617,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"vx":545,"on.key_release":552,"draw_cursor":639,"initialize_editor":678,"font":353,"update_editor_box":570,"mouse_cursor":558,"Mouse_cursor":559,"set_mouse_cursor":562,"draw_ticks":663,"line_height":365,"add_thick_line":400,"copy_shape":396,"order_of_magnitude":573,"on.mouse_release":554,"approximate":579,"approximate_up":658,"scale":7,"Ticks_font":669,"on.initialize":692,"A":507,"Surface":422,"fw_app":"driver","on.text_input":521,"on.draw":565,"Cursor_node":172,"Manifest":494,"fw_parent":692,"Viewport":604,"load_manifest":496,"y_of_schema1":364,"get_manifest":693,"on_text":539,"on_handle":547,"schema1_of_y":667,"Menu_background_color":611,"tick_spec":660,"Menu_border_color":612,"Definitions":503,"Menu_command_color":613,"on.update":561,"Menu_highlight_color":614,"on.keychord_press":666,"draw_menu_bar":641,"vy":546,"add_hotkey_to_menu":616,"Page":475,"on":1,"draw_manifest_navigator":677,"new_definition":681,"num_lines_for_manifest_navigator":676,"load_definition":682,"sy":469,"reset_manifest_navigator":621,"manifest_navigator_up":628,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"B":379,"get_definition_from_app":624,"Manifest_navigator":495}
get_manifest = function()live.send_to_app('MANIFEST')local response_stringrepeatlove.timer.sleep(0.01)response_string = live.receive_from_app()until response_stringlocal result = {}if #response_string == 0 then-- error; retryreturn resultelse-- stop retryingManifest_navigator.reload = falseendlocal app_namelocal response = json.decode(response_string)for name, value in pairs(response) doif not starts_with(name, 'fw_') thentable.insert(result, name)elseif name == 'fw_app' thenapp_name = valueendendreturn result, append