!7 concept Entry { S keyword, code; bool enabled = true; sS _fieldOrder = "keyword code enabled"; } set flag DynModule. cmodule KeywordToCode > DynCRUD { afterVisualize { tablePopupMenuItemThreaded(table(), "Run", r { runEntry(selected(), "") }); } start { db(); dm_onTopInput(voidfunc(fS s) { thread { //print("KtC got: " + s); for (Entry e : list(Entry)) if (e.enabled && matchMethod(e.keyword, s)) runEntry(e, s); } }); } void runEntry(Entry e, S input) enter { if (e == null) ret; print("KtC running #" + e.id); S code = trim(e.code); bool say = startsWith(code, "="); if (say) code = substring(code, 1); try { temp tempSetTL(evalJava_prep_args, "fS s"); O result = dm_evalJava_withModule(code, input); if (say) dm_say(strOrNull(result)); } catch print _e { if (say) dm_say("Internal error, Sir"); } } // API bool matchMethod(S pat, S s) { ret matchX_vbar(pat, s); } bool isVoiceCommand(S s) { for (Entry e : list(Entry)) if (e.enabled && matchMethod(e.keyword, s)) true; false; } }