SHARE
TWEET

searchgui

unrealism Feb 3rd, 2020 560 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Menu, tray, add, Search AHK (Alt+F1), SearchAHK
  2. return
  3.  
  4. !F1::        ;alt + F1
  5. SearchAHK:
  6. Gui, Add, Edit, vSearchText w180
  7. Gui, Add, Radio, vSearchAt Checked, Forum
  8. Gui, Add, Radio, x+6, Docs
  9. Gui, Add, Radio, vSearchWith Checked x9 Group, DuckDuckGo
  10. Gui, Add, Radio, x+6, Google
  11. Gui, Add, Button, Default gSubmitSearch x9 w180, Search
  12. Gui, Show, AutoSize, Search AHK
  13. return
  14.  
  15. SubmitSearch:
  16. Gui, Submit, NoHide
  17. Gui, Destroy
  18. StringReplace, SearchText, SearchText, `%, `%25, All           ;    %    This Replace must be first
  19. StringReplace, SearchText, SearchText, `", `%22, All           ;    "
  20. StringReplace, SearchText, SearchText, #, `%23, All            ;    #
  21. StringReplace, SearchText, SearchText, &, `%26, All            ;    &
  22. StringReplace, SearchText, SearchText, +, `%2B, All            ;    +
  23. StringReplace, SearchText, SearchText, %A_Space%, +, All       ;        This Replace must always be below the line dirctly above it (+, `%2B)
  24. StringReplace, SearchText, SearchText, :, `%3A, All            ;    :
  25. StringReplace, SearchText, SearchText, `;, `%3B, All           ;    ;
  26. StringReplace, SearchText, SearchText, =, `%3D, All            ;    =
  27. StringReplace, SearchText, SearchText, ?, `%3F, All            ;    ?
  28. StringReplace, SearchText, SearchText, @, `%40, All            ;    @
  29. if (SearchWith = 1)
  30.     SearchWith := "duckduckgo.com?"
  31. else
  32.     SearchWith := "encrypted.google.com/search?hl=en&"
  33. if (SearchAt = 1)    ;Forum
  34.     Run    %    "https://" SearchWith "q=site%3Aautohotkey.com+" SearchText
  35. else                ;Docs
  36.     Run    %    "https://" SearchWith "q=site%3Al.autohotkey.net+" SearchText
  37. return
  38.  
  39. GuiClose:
  40. Gui, Destroy
  41. return
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top