Here's what I have:
Code: Select all
searchGoogle(query){
StringReplace, query, query, %A_Tab%, , ALL ;delete all tabs from text in keyboard
StringReplace, query, query, •, , ALL ;delete bullet points from text in keyboard
search = C:\Program Files (x86)\Google\Chrome\Application\chrome.exe https www.google.com /search?q="%query%" Broken Link for safety
KeyWait Enter
Run %search%
}
^CapsLock::
Clipboard =
Send, ^c
ClipWait
queries := Clipboard
StringReplace, queries, queries, %A_Tab%, , ALL ;delete all tabs from text in keyboard
StringReplace, queries, queries, •, , ALL ;delete bullet points from text in keyboard
InputBox, queries, Google Search, Edit Search term, , ,100, , , ,30,
Send, ^v ;<<<***********THIS IS THE PART THAT DOES NOT WORK********
if ErrorLevel
ControlClick,Cancel ,Google Search
else if (queries="")
msgbox,Input is empty
else
searchGoogle(queries)
return
What am I doing wrong?? Any help would be appreciated. Thanks!