ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > FARR Plugins and Aliases

filter_alias - FARR alias filter autohotkey helper script

(1/1)

Nod5:
filter_alias - the FARR alias filter autohotkey helper script

Useful especially if you are a FARR power user (which you should be!  ;D ) with a lot of custom aliases.


--- Code: Autohotkey ---#NoEnvSendMode InputSetWorkingDir %A_ScriptDir%#SingleInstance force ;filter_alias - FARR alias filter helper script ;WHY?;When a user has many aliases it can be a hassle to find and edit one of them;because the FARR options list isn't autosorted and has no filter/searchbox. ;SETUP;run the script (tip: make it autostart it on boot) ;USAGE;- open FARR options > aliases and press Ctrl+Space to show a filter box;- Type in box to filter alias name/regex rows;- Select a row and press Enter to jump to that row in FARR options;- Press Esc pr Ctrl+Space again to close filter_alias ;by Nod5 - version 161122;Listview filter code adapted from;https://autohotkey.com/boards/viewtopic.php?p=72578#p72578 #IfWinActive, ahk_class TOptionsForm^Space::gui, destroyif !winexist("filter_alias ahk_class AutoHotkeyGUI") goto showgui return#IfWinActive #IfWinActive, filter_alias ahk_class AutoHotkeyGUIEsc:: gui, destroy^Space:: gui, destroy#IfWinActive showgui:name = filter_aliasFileRead, f, %A_MyDocuments%\DonationCoder\FindAndRunRobot\AliasGroups\MyCustom\myaliases.aliasf := StrReplace(f, "</AliasText>", "")f := StrReplace(f, "</Regex>", "")xarr := []xarr2 := [] ControlGetPos, cx, cy,,, TListView1, ahk_class TOptionsFormWinGetPos, wx, wy,,, ahk_class TOptionsFormgx := cx+wx, gy := cy+wy Gui, Add, Edit, r1 vsearch gsearch, Gui, Add, ListView, r20 w400 h200 grid, Alias|Regex Loop, Parse, f, `n, `r{If InStr(A_LoopField, "<AliasText>") xali := SubStr(A_LoopField, InStr(A_LoopField, "<AliasText>") + 11)If InStr(A_LoopField, "<Regex>")  xreg := SubStr(A_LoopField, InStr(A_LoopField, "<Regex>") + 7)If InStr(A_LoopField, "<AliasEntry>") xali := xreg := ""  ;clear vars for new aliasif xali and (xreg or InStr(A_LoopField, "<Results>") ) ;stop at Result if no Regex  {  xreg := xreg ? xreg : a_space  LV_Add("", xali, xreg), xarr.push(xali) , xarr2.push(xreg)  xali := xreg := ""  ;clear vars for new alias  }}LV_ModifyCol(1, 120)LV_ModifyCol(2, 250)Gui, Show, x%gx% y%gy%, %name%return search:Gui, Submit, NoHideLV_Delete()For key, val In xarr{   If (search == "")    LV_Add("", val, xarr2[key])   Else    If InStr(val, search) or InStr(xarr2[key], search) ;match     LV_Add("", val, xarr2[key])}GuiControl, +Redraw, LVReturn #IfWinActive, filter_alias ahk_class AutoHotkeyGUIPgDn::Down::ControlGetFocus, contr, Aif !(contr == "Edit1") send {%a_thishotkey%}else if (LV_GetNext() == 0) send {Tab}{Down}else  send {Tab}return Enter::selrow := !LV_GetNext() ? 1 : LV_GetNext()LV_GetText(seltext, selrow, 1)gui, destroywinactivate, ahk_class TOptionsFormcontrolfocus, TListView1, ahk_class TOptionsFormsleep 50RegExMatch(seltext, "^[^ ]+",seldo)send % seldo ? seldo : seltextreturn#IfWinActive

IainB:
I missed that. Thanks for cross-posting.
Nice workaround script.
-IainB (November 29, 2016, 11:13 PM)
--- End quote ---

Navigation

[0] Message Index

Go to full version