I use this on my daily work, Using this to do searches on my inventory program but I still sometimes use it for google searching, youtube, Amazon, eBay, etc. But more often to do my personal inventory searches.
I thought this was a cool idea more people need to learn about. I was inspired and helped by many others, most I can do is share.
This is not the first program that can do this type of custom search but one I do know how to control and customize easily. You can change the background color, letter, size etc by themes. Google, Amazon, Ebay etc.
How to Use:
Just need to type Prefix_Search. For Example: "g AHK Search testing" Searches for AHK Search testing on Google
Code:
Code: Select all
;ToolTip for LAtl & Space
ToolTipCommands =
( LTrim
Please Reload to Close. Not Sure why ESC not Working
You can Still Drag Though :D
***********WEB SEARCHES**********
1)g_ Google Search
2)i_ Google Image Search
3)x_ Google Incognito Search
4)y_ Youtube Search
5)a_ Amazon Search
6)e_ Ebay Search
******GOOGLE TRANSLATIONS*****
1)kor_ korean
2)eng_ English
3)spa_ Spanish
4)chi_ Chinise
)
; Universal Searcher ========
#If WinActive(universal_window)
Down::Send, {Tab} ;move down
Up::Send, +{Tab} ;move up
Enter:: ;Gosub Buscar
NumpadEnter:: ;Gosub Buscar
gosub, Buscar
return
Esc::
ToolTip
Gui, Universal_Searcher: Destroy
return
^BackSpace::Send, ^a{Del} ;Send Delete ALL to del_win group Windows
; Universal Searcher PROJECT========
main_theme:
Description_text = Searching Inventory: `n"%Search%" ;if no match
Background_color = 00A03E ;C7C7C9
Editbox_color = EDEDED
Editbox_font_size = s16
Editbox_font_color = cblack
Editbox_font = Lucida Sans
Description_font_size = s11
Description_font_color = +cWhite ;I have no idea what the + sign does but it works ¯\_(ツ)_/¯
Description_font = Lucida Console
return
google_theme:
Description_text = Searching Google: `n"%Search%" ;if no match
Background_color = 0078D7
Editbox_color = EDEDED
Description_font_color = +cwhite
return
google_images_theme:
Description_text = Searching Google Images: `n"%newmatch%"
Background_color = 0078D7
Editbox_color = EDEDED
Description_font_color = +cwhite
return
youtube_theme:
Description_text = Searching YouTube: `n"%newmatch%"
Background_color = FF5454
Editbox_color = EDEDED
Description_font_color = +cwhite
return
SendAnywhere_theme:
Description_text = Send Anywhere: `n"%newmatch%" enter 6-digit code.
Background_color = F16F5F
Editbox_color = EDEDED
Description_font_color = +cwhite
return
Amazon_theme:
Description_text = Searching Amazon for: `n"%newmatch%"
Background_color = F4AE01
Editbox_color = EDEDED
Description_font_color = +cwhite
return
Ebay_theme:
Description_text = Searching Ebay for: `n"%newmatch%"
Background_color = F4AE01
Editbox_color = EDEDED
Description_font_color = +cwhite
return
Translator_theme:
Description_text = Translating: `n"%newmatch%"
Background_color = F16F5F
Editbox_color = EDEDED
Description_font_color = +cwhite
return
Clients_Search_theme:
Description_text = Searching Customer: `n"%newmatch%"
Background_color = 4CFF4C
Editbox_color = EDEDED
Description_font_color = +cblack
return
#If
LAlt & Space:: ;Open Buscador Universal
universal_window=Universal Searcher
IfWinExist, %universal_window%
{
WinActivate, %universal_window%
return
} else {
gosub, main_theme
Gui, Universal_Searcher: Cancel ;just in case it's still active, close it
IniRead, L_Search, %A_ScriptDir%\info.ini,Script_Properties,lastSearch ;reads latest search
; Gui Settings
Gui, Universal_Searcher: +AlwaysOnTop +ToolWindow -caption +LastFound +border ;sysmenu = min,max,close and icon ;+Border ;caption = the border and titlebar ; toolwindow = taskbar button & alt-tab;
Gui, Universal_Searcher: Color, %Background_color% , %Editbox_color% ;first one is for gui background, second is for the Gui editbox
; Gui Buttons, Pics, Texts
Gui, Universal_Searcher: font, %Editbox_font_size% %EditBox_font_color%, %Editbox_font% ;color and font for Edit Box
Gui, Universal_Searcher: Add, Edit, xp+0 yp+10 w380 vSearch gOnChangeMyText , %L_Search% ;Edit Box ;add xm w220 -E0x200 r1 to remove editbox borders but edit text looks weird
Gui, Universal_Searcher: font, %Description_font_size% %Description_font_color%, %Description_font% ;color and font for Description Text
Gui, Universal_Searcher: Add, Text, xp+5 yp+35 w375 r3 vhelpinghand, Inventory Searching for: `n"%Search%" ;Description
Gui, Universal_Searcher: Show, AutoSize, %universal_window% ;Show GUI
OnMessage( 0x200, "WM_MOUSEMOVE" ) ;let's mouse drag GUI
} return
WM_MOUSEMOVE( wparam, lparam, msg, hwnd )
{
if wparam = 1 ; LButton
PostMessage, 0xA1, 2,,, A ; WM_NCLBUTTONDOWN
}
Submit: ;subroutine for Submiting text from editbox (When you press Enter)
Gui, Universal_Searcher: Submit
IniWrite, %Search%, %A_ScriptDir%\info.ini,Script_Properties,lastSearch ;writes latest search
Clipboard =
Clipboard := Search
ClipWait
return
Changes:
GuiControl, Text, helpinghand, %Description_text%
Gui, Universal_Searcher: Color, %Background_color% ,%Editbox_color% ;first one is for gui background, second is for the Gui editbox
GuiControl, %Description_font_color%, helpinghand
return
RegexFormula:
RegExMatch(Search, "i)^([abcdefghiklmnopqrstvxyz]|kor|eng|spa|chi) (.*)", m) ;separates "Search" into 2 parts
type := m1 ;type of the search... y,g,i,e,a...etc (part1)
newmatch := m2 ;stores the modified search (part2)
return
OnChangeMyText:
Gui, Universal_Searcher: Submit, NoHide ; Get the info entered in the GUI without force closing window
gosub, RegexFormula
If (type = "g"){
gosub, google_theme
gosub, Changes
} else If (type = "i"){
gosub, google_images_theme
gosub, Changes
} else If (type = "y"){
gosub, youtube_theme
gosub, Changes
} else If (type = "a"){
gosub, Amazon_theme
gosub, Changes
} else If (type = "e"){
gosub, Ebay_theme
gosub, Changes
} else If (type = "kor"){
gosub, Translator_theme
gosub, Changes
} else If (type = "eng"){
gosub, Translator_theme
gosub, Changes
} else If (type = "spa"){
Description_text = Translating... `n"%newmatch%" into SPANISH.
gosub, Translator_theme
gosub, Changes
} else If (type = "chi"){
gosub, Translator_theme
gosub, Changes
} else If (type = "c"){
gosub, Clients_Search_theme
gosub, Changes
} else {
gosub, main_theme
gosub, Changes
} return
Buscar: ;MAIN SEARCH PROCESS
ToolTip
gosub, Submit
Gui, Universal_Searcher: Destroy
gosub, RegexFormula
If (type = "g"){
Run, "https://www.google.com/search?num=50&safe=off&site=&source=hp&q=%newmatch%&btnG=Search&oq=&gs_l="
} else If (type = "i"){
Run, "http://www.google.com/search?q=%newmatch%&um=1&ie=UTF-8&tbm=isch&source=og&sa=N&hl=en&tab=wi&biw=1920&bih=1075"
} else If (type = "x"){
Run, "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe -incognito https://www.google.com/search?safe=off&q=%newmatch%"
} else If (type = "y"){
Run, "https://www.youtube.com/results?search_query=%newmatch%"
} else If (type = "a"){
Run, "www.amazon.com/s/ref=nb_sb_noss?url=search-alias`%3Daps&field-keywords=%newmatch%"
} else If (type = "e"){
Run, "www.ebay.com/sch/%newmatch%"
} else If (type = "kor"){
Run, "https://translate.google.com/#auto/ko/%newmatch%"
} else If (type = "eng"){
Run, "https://translate.google.com/#auto/en/%newmatch%"
} else If (type = "spa"){
Run, "https://translate.google.com/#auto/es/%newmatch%"
} else If (type = "chi"){
Run, "https://translate.google.com/#auto/zh-CN/%newmatch%"
} else {
MsgBox, You Should Try other Prefixes.
ToolTip, %ToolTipCommands% ;Help menu Tootip
}
return
Please tell me how you would add any other code or fix to make this better as I am still a beginner.