Topics - Nod5 [ switch to compact view ]

Pages: prev1 2 3 4 5 [6] 7 8 9 10 11 ... 22next
26
An unwanted scrollbar appear for regex aliases with only one result. The scrollbar shows only for the first matching character and disappears after the next character.

1.PNG
2.PNG

Reproduce the issue with this alias (temporary disable any other alias with the same regex pattern)

alias:      bar
regex:    ^(ba|bar)$
results:   test | C:\

The issue only occurs for single result aliases. If we update the alias with a second result line then the scrollbar never shows
3.PNG

Tested in FARR v2.233.01 and v2.229.01 in Windows 10. I tested changing some visual settings (disable skin, resize fonts, ...) but the issue persists. I might have missed something though.

27
Request 1: add a method to silently reload all aliases from .alias files

Request 2: add a FARR alias reload method that also updates the disabled/enabled status for each alias based on if it has the Disabled element in the .alias file.

These changes would enable users to script changes directly to .alias files and then quickly and silently apply them.

Background
The FARR special search string "goareload" reloads/updates aliases from .alias files. But not silently since after the reload it forces the "agroups" command that show all aliases as a list in FARR results. For request 1 make a new special search string "goareload_silent" that differ only in that it does not force "agroups".

The least visible workaround I've found to reload aliases from file:
1. FindAndRunRobot.exe -search goareload
2. FindAndRunRobot.exe -hide
But the FARR window still flickers briefly and sometimes the -hide command fail when scripting these steps (timing issues)

Edit
We can also reload aliases from file with the exit and restart method:
1. FindAndRunRobot.exe -exit
2. script changes to .alias file
3. FindAndRunRobot.exe -hide
Advantage over "goareload": No results window flickering. Drawback: FARR restart can make this method slower.
Edit end

Request 2 is because FARR's "goareload" command ignores "<Disabled>" elements in the .alias files. Disabled/enabled status is instead ruled by the FindAndRunRobot.ini line DisabledAliasStrings . In other words having a script add the line "<Disabled>true</Disabled>" to an .alias file AliasEntry section has no effect even though all other changes to .alias file elements are applied by "goareload".

The least visible workaround I've found to modify Disabled/Enabled status of aliases:
1. FindAndRunRobot.exe -exit
2. have a script read, modify and overwrite the string for DisabledAliasStrings in FindAndRunRobot.ini
3. FindAndRunRobot.exe -hide

But that can take several seconds and is sensitive to timing issues.

Request 2 could be done as a separate special search string. Or a FARR setting to toggle authority over disabled/enabled status between .ini and .alias files. Or a combo special search string that for both request 1 and 2, e.g. "goareload_silent_alsodisabledstatus".

28
Request: add a keyboard shortcut to run the context menu "Explore here" command that opens the selected file's folder in Explorer. I suggest ctrl+o as in Open. The context menu's "Explore here" works on all files including local .url files.

Background:
With AutoHotkey we can achieve this for most files by using FARR's control+C shortcut to copy a file's full path.
But that does not work on local .url files since for them FARR's ctrl+C copies the URL rather than the full path to the local file.
A non perfect workaround sends keys to open the context menu.

Code: Autohotkey [Select]
  1. ;control+o to open folder for selected file in FARR
  2. #IfWinActive, ahk_exe FindAndRunRobot.exe
  3. ^o::
  4. ControlGetFocus, cFocus, A
  5. if (cFocus == "TNextGrid1")
  6. {
  7.   send ^c
  8.   SplitPath, clipboard, , dir
  9.   If InStr( FileExist(dir) , "D")
  10.     Run % dir
  11.   ;workaround for .url files where FARR's ctrl+C return the URL
  12.   ;limitation: the context menu briefly flashes and send keys may fail
  13.   Else If InStr(clipboard, "://")
  14.   {
  15.     send +{AppsKey}
  16.     send e
  17.   }
  18. }
  19. return

edit: clarified and added workaround in the AutoHotkey script

29
Background
Imagine a user has these two aliases and one search directory item in FARR.

Alias1 (example of regex to get a single static result)
text: a
regex: ^a$
result: C:\folder\app.exe

Alias2 (example of regular expression aliases as search templates)
text: cdir
regex: ^(?:c|cd|cdi|cdir) (.+)$
result: dosearch +cdir $$1

Search Directory item
directory path: C:\cdir
optional modifier keywords: cdir

Problem case
The user types "c a" and want as result the list of files/folder in C:\cdir that contain "a".
But instead the result is "C:\folder\app.exe" . Because Alias1 is triggered by the new "a" search and since it is a regex alias it gets priority.

Collisions like that increase the more aliases of these two sorts one has. A pity since both sorts of aliases are useful.

Request for solution
Add a new virtual launch string named dosearch_noregex to FARR.
dosearch_noregex would start a new search but ignore all alias regex matches.

30
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 [Select]
  1. SetWorkingDir %A_ScriptDir%
  2.  
  3. ;filter_alias - FARR alias filter helper script
  4.  
  5. ;WHY?
  6. ;When a user has many aliases it can be a hassle to find and edit one of them
  7. ;because the FARR options list isn't autosorted and has no filter/searchbox.
  8.  
  9. ;SETUP
  10. ;run the script (tip: make it autostart it on boot)
  11.  
  12. ;USAGE
  13. ;- open FARR options > aliases and press Ctrl+Space to show a filter box
  14. ;- Type in box to filter alias name/regex rows
  15. ;- Select a row and press Enter to jump to that row in FARR options
  16. ;- Press Esc pr Ctrl+Space again to close filter_alias
  17.  
  18. ;by Nod5 - version 161122
  19. ;Listview filter code adapted from
  20. ;https://autohotkey.com/boards/viewtopic.php?p=72578#p72578
  21.  
  22. #IfWinActive, ahk_class TOptionsForm
  23. ^Space::
  24. if !winexist("filter_alias ahk_class AutoHotkeyGUI")
  25.  goto showgui
  26. return
  27.  
  28. #IfWinActive, filter_alias ahk_class AutoHotkeyGUI
  29. Esc:: gui, destroy
  30. ^Space:: gui, destroy
  31.  
  32. showgui:
  33. name = filter_alias
  34. FileRead, f, %A_MyDocuments%\DonationCoder\FindAndRunRobot\AliasGroups\MyCustom\myaliases.alias
  35. f := StrReplace(f, "</AliasText>", "")
  36. f := StrReplace(f, "</Regex>", "")
  37. xarr := []
  38. xarr2 := []
  39.  
  40. ControlGetPos, cx, cy,,, TListView1, ahk_class TOptionsForm
  41. WinGetPos, wx, wy,,, ahk_class TOptionsForm
  42. gx := cx+wx, gy := cy+wy
  43.  
  44. Gui, Add, Edit, r1 vsearch gsearch,
  45. Gui, Add, ListView, r20 w400 h200 grid, Alias|Regex
  46.  
  47. Loop, Parse, f, `n, `r
  48. {
  49. If InStr(A_LoopField, "<AliasText>")
  50.  xali := SubStr(A_LoopField, InStr(A_LoopField, "<AliasText>") + 11)
  51. If InStr(A_LoopField, "<Regex>")
  52.   xreg := SubStr(A_LoopField, InStr(A_LoopField, "<Regex>") + 7)
  53. If InStr(A_LoopField, "<AliasEntry>")
  54.  xali := xreg := ""  ;clear vars for new alias
  55. if xali and (xreg or InStr(A_LoopField, "<Results>") ) ;stop at Result if no Regex
  56.   {
  57.   xreg := xreg ? xreg : a_space
  58.   LV_Add("", xali, xreg), xarr.push(xali) , xarr2.push(xreg)
  59.   xali := xreg := ""  ;clear vars for new alias
  60.   }
  61. }
  62. LV_ModifyCol(1, 120)
  63. LV_ModifyCol(2, 250)
  64. Gui, Show, x%gx% y%gy%, %name%
  65. return
  66.  
  67. search:
  68. Gui, Submit, NoHide
  69. For key, val In xarr
  70. {
  71.    If (search == "")
  72.     LV_Add("", val, xarr2[key])
  73.    Else
  74.     If InStr(val, search) or InStr(xarr2[key], search) ;match
  75.      LV_Add("", val, xarr2[key])
  76. }
  77. GuiControl, +Redraw, LV
  78. Return
  79.  
  80. #IfWinActive, filter_alias ahk_class AutoHotkeyGUI
  81. PgDn::
  82. Down::
  83. ControlGetFocus, contr, A
  84. if !(contr == "Edit1")
  85.  send {%a_thishotkey%}
  86. else if (LV_GetNext() == 0)
  87.  send {Tab}{Down}
  88. else
  89.  send {Tab}
  90. return
  91.  
  92. Enter::
  93. selrow := !LV_GetNext() ? 1 : LV_GetNext()
  94. LV_GetText(seltext, selrow, 1)
  95. winactivate, ahk_class TOptionsForm
  96. controlfocus, TListView1, ahk_class TOptionsForm
  97. RegExMatch(seltext, "^[^ ]+",seldo)
  98. send % seldo ? seldo : seltext
  99. return

Pages: prev1 2 3 4 5 [6] 7 8 9 10 11 ... 22next
Go to full version