Code: Select all
;- modified=20160505
;- mark text and press F8 / writes marked text to EditField ---------
;- or type in edit-field the word you want to search
#Warn
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
ftext=Mark_Text_and_press F8
F1=%a_scriptdir%\%ftext%.ini
ix=11 ;- total checkboxes
src=tan soo suan+carmen ;- TEST search for preselect
;GUI,2:+AlwaysOnTop
Gui,2: Color, ControlColor, Black
Gui,2: Font, CDefault, Lucida Console
Loop,%ix%
{
IniRead, Ch%A_Index%, %f1%, ss, Cb%A_Index% , 0
If (Ch%A_Index% = 1)
Cb%A_Index% = Checked
Else
Cb%A_Index% =
}
Gui,2: Show, NA x100 y5 w300 h500, %ftext%
Gui,2: Add, Edit, x20 y5 w265 h20 cWhite vSearchx,%src%
Gui,2: Add, CheckBox, x20 y40 vCh1 %cb1% cYellow, Google
Gui,2: Add, CheckBox, x20 y65 vCh2 %cb2% cYellow, Google I``m feeling lucky
Gui,2: Add, CheckBox, x20 y90 vCh3 %cb3% cYellow, Bing Pictures
Gui,2: Add, CheckBox, x20 y115 vCh4 %cb4% cYellow, Flickr Pictures
Gui,2: Add, CheckBox, x20 y140 vCh5 %cb5% cYellow, Google Pictures
Gui,2: Add, CheckBox, x20 y165 vCh6 %cb6% cYellow, Google News
Gui,2: Add, CheckBox, x20 y190 vCh7 %cb7% cYellow, Google News NL
Gui,2: Add, CheckBox, x20 y215 vCh8 %cb8% cYellow, Google PDF
Gui,2: Add, CheckBox, x20 y240 vCh9 %cb9% cYellow, Google Video
Gui,2: Add, CheckBox, x20 y265 vCh10 %cb10% cYellow, Youtube Video
Gui,2: Add, CheckBox, x20 y290 vCh11 %cb11% cYellow, Wikipedia
Gui,2: Add, CheckBox, x20 y400 vCh98 gCheckAll cYellow, Select All
Gui,2: Add, CheckBox, x20 y425 vCh99 gUnCheckAll cYellow, De-Select All
Gui,2: Add, Button, x10 y465 w100 h26 gAA ,Start
GuiControl,2:Focus,Searchx
clipboard=
return
;----------------------------------------------------------
F8::
gui,2:submit,nohide
Send ^c ;- copies marked text
IfWinNotActive,%ftext%, , WinActivate, %ftext%,
WinWaitActive,%ftext%
sleep,900
GuiControl,2:,Searchx,
cl:=clipboard
cl=%cl%
GuiControl,2:,Searchx,%cl%
clipboard =
return
;------------------------------
CheckAll:
Loop, %ix%
GuiControl,2:, Ch%A_Index%, 1
GuiControl,2:, Ch99, 0
Return
;------------------------------
UnCheckAll:
Loop, %ix%
GuiControl,2:, Ch%A_Index%, 0
GuiControl,2:, Ch98, 0
Return
;------------------------------
;------------------------------
AA:
Gui,2: submit, nohide
c1=
c2=
stringsplit,c,searchx,`+
c1=%c1%
c2=%c2%
c1=`%22%c1%`%22
if c2<>
{
c2=`%22%c2%`%22
stringreplace,c2,c2,%A_space%, +, All
searchx=%c1% and %c2%
}
else
{
stringreplace,c1,c1,%A_space%, +, All
searchx=%c1%
}
if Ch1
run,http://www.google.de/search?hl=&q=%searchx%
if Ch2
run,http://www.google.com/search?btnI=I`%27m+Feeling+Lucky&q=%searchx%
if Ch3
run,http://www.bing.com/images/search?q=%searchx%&FORM=HDRSC2
if Ch4
run,https://www.flickr.com/search/?q=%searchx%
if Ch5
run,https://www.google.com/search?q=%searchx%&tbm=isch
if Ch6
run,https://www.google.com/search?q=%searchx%#q=%searchx%&tbm=nws
if Ch7
run,https://www.google.com/search?q=%searchx%#q=%searchx%&tbm=nws&hl=nl ;- hl=nl nederlands
if Ch8
run,http://www.google.de/search?hl=&q=%searchx% filetype:pdf
if Ch9
run,https://www.google.com/search?q=%searchx%#q=%searchx%&tbm=vid
if Ch10
run,http://www.youtube.com/results?search_query=%searchx%
if Ch11
{
StringReplace,searchx,c1,+,%A_space%, All
StringUpper,searchx,searchx,T
StringReplace,searchx,searchx,%A_space%,_, All
StringReplace,searchx,searchx,`%22, , All
run, http://en.wikipedia.org/wiki/%searchx%
}
c1=
c2=
return
;------------------------------
;------------------------------
2GuiClose:
Gui,2: Submit,nohide
Loop,%ix%
{
ex= % ch%a_index%
IniWrite, %ex%, %f1%, ss, Cb%a_index%
}
ExitApp
;---------------------------------------------------------------
;===============================================================