public static RibbonTab add_Group_FindAndExecuteScripts(this RibbonTab ribbonTab) { Func <string, List <String> > getLocalFileMappings = (filter) => { var currentFileMappings = CompileEngine.LocalScriptFileMappings; return((from item in currentFileMappings.Keys where item.regEx(filter) select item).toList().sort()); }; var searchTextBox = ribbonTab.add_Group("Find and Execute O2 Scripts") .add_TextBox("RegEx:", "", 200); var comboBox = ribbonTab.group("Find and Execute O2 Scripts") .add_ComboBox("(enter a search term above)"); searchTextBox.onTextChange( (text) => { var results = getLocalFileMappings(text); comboBox.clear(); comboBox.add_Item("[Found {0} Scripts]".format(results.size())); comboBox.add_Items(results); comboBox.selectedIndex(0); }); ribbonTab.group("Find and Execute O2 Scripts") .add_Button("Execute Selected Script", () => { var scriptToExecute = comboBox.selectedItem().local(); if (scriptToExecute.fileExists()) { "Executing script:{0}".info(scriptToExecute); if (scriptToExecute.extension(".h2")) { scriptToExecute.executeH2Script(); } else { scriptToExecute.executeFirstMethod(); } } }); searchTextBox.set_Text(".*h2"); return(ribbonTab); }