Simple GUI that you can use to quickly search for terms via the forum search or a Google search. This version does a basic check/replace for unsafe URL characters. I keep this in its own script and run it from my main script as needed, but it can easily be adjusted to be added to an existing script.
Hopefully someone finds it useful.
Code: Select all
toEncode := [" ","%", """", "#", "&"
, "/", ":", ";", "<"
, "=", ">", "?", "@"
, "[", "\", "]", "^"
, "``", "{", "|", "}", "~"]
e := ["+","%25", "%22", "%23", "%26"
, "%2F", "%3A", "%3B", "%3C"
, "%3D", "%3E", "%3F", "%40"
, "%5B", "%5C", "%5D", "%5E"
, "%60", "%7B", "%7C", "%7D", "%7E"]
Gui, Add, Text, x10 y10 h20, Search Autohotkey's site documentation, or search from Google:
Gui, Add, Edit, yp+20 wp vSearch,
Gui, Add, Button, yp+30 w77 h26 gfSearch, &Forum Search
Gui, Add, Button, xp+85 wp hp ggSearch, &Google It!
Gui, Show, AutoSize Center, Quick Search for Autohotkey
return
fSearch:
gSearch:
Gui, Submit
Gui, Destroy
For i, u in toEncode ; check/replace loop for unsafe chars
StringReplace, Search, Search, % u, % e[i], All
if (A_ThisLabel="fSearch") ; if the forum search was selected
Run, https://www.autohotkey.com/boards/search.php?keywords=%Search% ; use the forum search
else Run, http://www.google.com/search?q=%Search%+site:autohotkey.com ; else use Google search
ExitApp
GuiClose:
Gui, Destroy
ExitApp