How can I grab the domain from an email address (via input box) and open that domain in a browser? My input will always be an email address. So in the input box I type
Code: Select all
who foobar@somedomain.com
Code: Select all
InputBox, Input, Meta search, Prefixes: g`, who`, ,250, 250
DivPos:=InStr(Input, " ")
Prefix:=SubStr(Input, 1, DivPos-1)
SearchText:=SubStr(Input, DivPos+1)
StringReplace, SearchText, SearchText, %A_Space%, `%20, All
StringReplace, SearchText, SearchText, #, `%23, All
SearchText:=Trim(SearchText)
if (Prefix="g")
{
//Do something.
}
else if (Prefix="who")
{
Run, "www.google.com/search?hl=en&q=%SearchText%" //open browser and searches google for the email address
Run, "%SearchText%" //should open a new tab browser and go to the URL
}
return