Page 1 of 1

AutoHotkey Online Help with F1

Posted: 08 Sep 2017, 20:57
by icuurd12b42
After 3 hours of trying to add F1 help for selected AHK functions in Visual Studio Code

See this thread: https://autohotkey.com/boards/viewtopic ... 60&t=12525

I had a facepalm moment and did the obvious... I made a AHK script, duh

[5 edits later...there that should cover everything]

Code: Select all

#SingleInstance FORCE
#Persistent
SetTitleMatchMode, 2
#IfWinActive .ahk
^F1::
clipboard := ""
send ^c
sleep,100
txt := StrReplace(trim(clipboard),"#","")
if(txt<>"")
{
	site := "https://duckduckgo.com?q=" . txt . " site:https://www.autohotkey.com/docs/"
	Run %site%
}
return

#IfWinActive .ahk
+F1::
clipboard := ""
send ^c
sleep,100
txt := StrReplace(trim(clipboard),"#","")
if(txt<>"")
{
	site := "https://duckduckgo.com?q=" . txt . " site:https://www.autohotkey.com/boards"
	Run %site%
}
return
ctrl+F1 for docs
shift+F1 for forum
I left F1 alone so not to interfere with the default F1 action of the app...

Works in Visual Studio Code, Notepad++, Notepad... and should for any editor that show a <filename>.ahk in it's title bar...

Re: AutoHotkey Online Help with F1

Posted: 09 Sep 2017, 00:12
by BoBo
https://duckduckgo.com?q=" . txt . "&site:https://www.autohotkey.com/boards

Not sure if this works more reliable?!

Re: AutoHotkey Online Help with F1

Posted: 09 Sep 2017, 00:27
by icuurd12b42
https://search.site.com/q=search site:www.sitename.com/whatnot
is pretty much the adopted standard for all search engines now. so not sure about passing site as a second argument...