Try this. There were syntax errors in your script - I escaped % characters, corrected "elseif" to "else if" and added control if cancel is pressed or the entered string is empty.
Code: Select all
InputBox, Input, Meta search, Prefixes: g`, shop`, Tools`, costco`, Music`, Movie etc.,, 320, 130
if errorlevel
return
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 not prefix
return
if (Prefix="g")
{
Run, "www.google.com/search?hl=en&q=%SearchText%"
Run, "www.google.com/search?site=imghp&tbm=isch&q=%SearchText%"
Run, "www.google.com/maps/search/%SearchText%"
}
else if (Prefix="shop")
{
Run, "https://smile.amazon.com/s/ref=nb_sb_noss_2?url=search-alias`%3Daps&field-keywords=%SearchText%"
Run, "http://smile.amazon.com/s/ref=nb_sb_noss?url=me`%3DA2L77EE7U53NWQ&field-keywords=%SearchText%&x=0&y=0"
Run, "http://camelcamelcamel.com/search?sq=%SearchText%"
Run, "https://www.costco.com/CatalogSearch?dept=All&keyword=%SearchText%"
Run, "http://www.homedepot.com/s/%SearchText%?NCNI-5"
Run, "https://www.inoreader.com/search/%SearchText%/public"
Run, "http://www.lowes.com/Search=%SearchText%?storeId=10151&langId=-1&catalogId=10051&N=0&newSearch=true&Ntt=test#!"
Run, "http://www.monoprice.com/Search?keyword=%SearchText%"
Run, "http://www.newegg.com/Product/ProductList.aspx?Submit=ENE&DEPA=0&Order=BESTMATCH&Description=%SearchText%"
Run, "http://slickdeals.net/newsearch.php?q=%SearchText%&searcharea=deals&searchin=first"
Run, "https://www.walmart.com/search/?cat_id=0&facet=retailer`%3AWalmart.com&query=%SearchText%&vertical_whitelist=home`%2C#searchProductResult"
Run, "http://www.target.com/s?searchTerm=%SearchText%"
Run, "https://www.costcobusinessdelivery.com/CatalogSearch?storeId=11301&catalogId=11701&langId=-1&keyword=%SearchText%"
Run, https://www.bestbuy.com/site/searchpage.jsp?st=%SearchText%&_dyncharset=UTF-8&id=pcat17071&type=page&sc=Global&cp=1&nrp=&sp=&qp=&list=n&af=true&iht=y&usc=All+Categories&ks=960&keys=keys"
Run, "http://www.acehardware.com/search/index.jsp?kwCatId=&kw=%SearchText%&origkw=%SearchText%&f=Taxonomy/ACE/19541496&sr=1"
Run, "https://www.bhphotovideo.com/c/search?Ntt=%SearchText%&N=0&InitialSearch=yes&sts=ma&Top+Nav-Search="
Run, "https://www.adorama.com/l/?searchinfo=%SearchText%"
Run, "https://www.bedbathandbeyond.com/store/s/%SearchText%?ta=typeahead"
Run, "https://www.staples.com/%SearchText%/directory_%SearchText%?"
Run, "https://www.rakuten.com/search/%SearchText%/"
Run, "https://express.google.com/s?q=%SearchText%"
Run, "https://www.google.com/express/search?m=9090995&q=%SearchText%&oq=%SearchText%&g_sl=localmall.3..47.875419.875897.0.875968.4.4.0.0.0.0.108.292.3j1.4.0...0.0...1ac.1.Jy7_yZjVbcU"
Run, "https://www.inoreader.com/search/%SearchText%"
}
else if (Prefix="Tools")
{
Run, "http://www.homedepot.com/s/%SearchText%?NCNI-5"
Run, "http://www.acehardware.com/search/index.jsp?kwCatId=&kw=%SearchText%&origkw=%SearchText%&f=Taxonomy/ACE/19541496&sr=1"
Run, "https://www.walmart.com/search/?cat_id=0&facet=retailer`%3AWalmart.com&query=%SearchText%&vertical_whitelist=home`%2C#searchProductResult"
Run, "http://www.lowes.com/Search=%SearchText%?storeId=10151&langId=-1&catalogId=10051&N=0&newSearch=true&Ntt=test#!"
Run, "https://www.harborfreight.com/catalogsearch/result/index/?dir=asc&limit=60&order=EAScore`%2Cf`%2CEAFeatured+Weight`%2Cf`%2CSale+Rank`%2Cf&q=%SearchText%"
}
else if (Prefix="costco")
{
Run, "https://costco97.com/?s=%SearchText%"
Run, "http://www.adamcos.com/Costco/search.php %SearchText%"
Run, "https://www.costco.com/CatalogSearch?dept=All&keyword=%SearchText%"
Run, "https://www.pricecase.com/search/all/%SearchText%"
Run, "https://www.costcobusinessdelivery.com/CatalogSearch?storeId=11301&catalogId=11701&langId=-1&keyword=%SearchText%"
Run, "https://www.google.com/search?safe=off&biw=2004&bih=1052&tbm=isch&sa=1&ei=xXlfW6iMB9DS_wS8_onIBg&q=costco+%SearchText%&oq=costco+%SearchText%&gs_l=img.3...3682.5287.0.5500.8.8.0.0.0.0.132.669.6j2.8.0....0...1c.1.64.img..0.3.317...0j0i67k1.0.iGs0UiG5988"
}
else if (Prefix="Music")
{
Run, "https://www.inoreader.com/search/%SearchText%/public"
}
else if (Prefix="Movie")
{
Run, "https://www.inoreader.com/search/%SearchText%/public"
Run, "http://www.imdb.com/find?s=all&q=%SearchText%"
Run, "https://www.inoreader.com/search/%SearchText%"
}
else if (Prefix="Book")
{
Run, "https://www.inoreader.com/search/%SearchText%/public"
Run, "https://sfpl.bibliocommons.com/search?utf8=?&t=smart&search_category=keyword&q=%SearchText%&commit=Search"
Run, "https://catalog.plsinfo.org/search/X?SEARCH=%SearchText%&searchscope=1&SORT=D"
}
else if (Prefix="PCApp")
{
Run, "https://www.inoreader.com/search/%SearchText%/public"
Run, "https://www.google.com/search?q=site:www.nsaneforums.com+%SearchText%&ie=UTF-8"
Run, "https://cse.google.com/cse?cx=partner-pub-0492687750134555`%3A0046060402&ie=UTF-8&q=%SearchText%#gsc.tab=0&gsc.q=%SearchText%&gsc.page=1"
}
else if (Prefix="MA")
{
Run, "https://www.inoreader.com/search/%SearchText%/public"
Run, "https://macbb.org/search/%SearchText%"
Run, "https://www.macserialjunkie.com/forum/search.php/%SearchText%"
}
else if (Prefix="Amazon")
{
Run, "http://fakespot.com/analyze?utf8=`%E2`%9C`%93&url=%SearchText%"
Run, "http://reviewmeta.com/amazon/%SearchText%"
Run, "https://smile.amazon.com/s/ref=nb_sb_noss_2?url=search-alias`%3Daps&field-keywords=%SearchText%"
Run, "http://smile.amazon.com/s/ref=nb_sb_noss?url=me`%3DA2L77EE7U53NWQ&field-keywords=%SearchText%&x=0&y=0"
Run, "http://camelcamelcamel.com/search?sq=%SearchText%"
}
return