topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Wednesday April 24, 2024, 2:54 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Add alias to the context menu  (Read 3596 times)

ertwro

  • Participant
  • Joined in 2019
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
Add alias to the context menu
« on: August 13, 2023, 01:12 AM »
Hi, Mouser. I enjoy greatly your software after all these years. Recently I've started using QuickLook, app in windows that allows me to see a preview of a file by just pressing <Space> in my keyboard. While I would love to add a hotkey like {Ctrl + [0-9]} or space, I've added the following alias to farr to use it in the search list but I do wonder if there's a way to integrate it in the context menu?
Regex: ^(.*)\sql$
Results: C:\Users\ertwr\AppData\Local\Programs\QuickLook\QuickLook.exe "$$1"

Thanks in advance

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Add alias to the context menu
« Reply #1 on: August 14, 2023, 04:41 AM »
Yes FindAndRunRobot is still a great piece of software - thank you mouser!  :)

Not a built in solution but this AutoHotkey script lets you set a hotkey and should work at least when the result is just a filepath. To also handle results with more complex syntax more code steps would be needed.

#Requires AutoHotkey v2
;press ctrl+q to QuickLook on first or selected FARR result
#HotIf WinActive("ahk_exe FindAndRunRobot.exe")
^q::
{
    ;if searchbox is active navigate to first result
    if "TNextGrid1" != ControlGetClassNN(ControlGetFocus("A"))
        Send("{Down}")
    if "TNextGrid1" != ControlGetClassNN(ControlGetFocus("A"))
        return
    ;ctrl+C puts focused FARR result's path on clipboard
    A_Clipboard := ""
    Send("^c")
    ClipWait(100)
    if A_Clipboard && FileExist(A_Clipboard)
        Run('"C:\Users\ertwr\AppData\Local\Programs\QuickLook\QuickLook.exe" "' A_Clipboard '"')
}
#HotIf

ertwro

  • Participant
  • Joined in 2019
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
Re: Add alias to the context menu
« Reply #2 on: August 24, 2023, 11:54 PM »
Dear @Nod5,

Thank you for sharing your script. Your kindness is greatly appreciated. I had previously created something similar, but was hesitant to add more scripts to my Windows startup folder or, even worse, to start and close them manually. I noticed that FARR has a scripts folder and was wondering if it could be used to automatically launch a script when FARR starts and close it when FARR is closed. For now, the closest solution to what I am looking for is adding QuickLook to the toolbar, which I dislike because it requires the use of a mouse. However, at least I do not have to manually close, autostart or launch anything.

Best regards,