ioliver Posted September 26, 2005 Share Posted September 26, 2005 (edited) Here's the code: CODE; Magic Clip.au3 ; ; September 26, 2005 ; This script will allow you to define, or Google a word or phrase in the clipboard. ClipPut("") While 1 ;Infinite Loop ;If WinActive("") Then ; You can use this code if you only want Magic Clip ; to work for certain applications. i.e. OpenOffice.org $clip = ClipGet() If $clip <> "" Then $Magic = MsgBox(4,"Do you want to run Magic Clip?", $clip, 3) If $Magic = 6 Then Call ("Go") Else MsgBox(0, "Magic Clip", $clip & " will be available on the Clipboard for 25 seconds.", 3) Sleep(25000) ClipPut("") EndIf EndIf ;EndIf ; You can use this code if you only want Magic Clip ; to work for certain applications. i.e. OpenOffice.org Sleep(5) ;Reduces the load this script puts on the CPU time Wend Func Go() $define = MsgBox(4, "Do you want to define?", $clip, 3) If $define = 6 Then Run("C:\Program Files\Internet Explorer\iexplore.exe http://dictionary.reference.com/search?q=" & $clip) ClipPut("") Else $google = MsgBox(4, "Do you want to Google?", $clip, 3) If $google = 6 Then Run("C:\Program Files\Internet Explorer\iexplore.exe http://www.google.com/search?q=" & $clip) ClipPut("") EndIf EndIf EndFunc I just put this together. It could be better with some work, but it's kind of a concept for now. While the script is running, you can look-up, or Google any word or pharse that you copy to the clipboard. Let me know what you think. Thanks, Ian Edited September 26, 2005 by ioliver "Blessed be the name of the Lord" - Job 1:21Check out Search IMF Link to comment Share on other sites More sharing options...
w0uter Posted September 26, 2005 Share Posted September 26, 2005 (edited) i hate IE. why does evryone keep trying to make me use it. also the app just kills the practial use of the clipboard IMO. i would make it like this: select something hit a hotkey back up the clip copy the selection look it up put the old selection back but thats just me. Edited September 26, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
ioliver Posted September 26, 2005 Author Share Posted September 26, 2005 i hate IE. why does evryone keep trying to make me use it.also the app just kills the practial use of the clipboard IMO.i would make it like this:select somethinghit a hotkeyback up the clipcopy the selectionlook it upput the old selection backbut thats just me.Thanks Wouter,Those are all great ideas. Do you know the command to open an URL, not using IE? I'm pretty sure there is one, but I can't remember it.And, it does ,kind of, kill the function of the clipboard.Thanks,Ian "Blessed be the name of the Lord" - Job 1:21Check out Search IMF Link to comment Share on other sites More sharing options...
w0uter Posted September 26, 2005 Share Posted September 26, 2005 UDF in my sig. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
ioliver Posted September 26, 2005 Author Share Posted September 26, 2005 wOuter, I looked at your code, but I can't figure out the usage... I tried Call("_INetBrowse(http://my.url.here, <blank>)") Is that the proper syntax? Thanks again, Ian "Blessed be the name of the Lord" - Job 1:21Check out Search IMF Link to comment Share on other sites More sharing options...
w0uter Posted September 26, 2005 Share Posted September 26, 2005 (edited) what is it with you guys and Call. you dont need Call. _INetBrowse("http://my.url.here.com") Edited September 26, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
B3TA_SCR1PT3R Posted September 26, 2005 Share Posted September 26, 2005 or you could use a simple DOS command _RunDOS("start *website*") opens firefox. and if you dont have firefox itll blow up your computer [right][font="Courier New"]...Run these streets all day, I can sleep when I die.[/font] [/right] Link to comment Share on other sites More sharing options...
w0uter Posted September 26, 2005 Share Posted September 26, 2005 or you could use a simple DOS command_RunDOS("start *website*")opens firefox. and if you dont have firefox itll blow up your computerfails on urls with &'s in them. (its option 0 in my _INetBrouwse btw ) My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
ioliver Posted October 3, 2005 Author Share Posted October 3, 2005 (edited) Progress... CODE; Magic Clip v2.au3 ; Ian Oliver ; September 30, 2005 ; This script will allow you to define, or Goolge a word or phrase in the clipboard. ; Notes: ; # = Windows Key; ^ = Ctrl Key #include <GUIConstants.au3> Dim $currentclip Dim $newclip Dim $newclips HotKeySet("#z", "MagicClip") ;HotKeySet("#zd", "define") ; May be implemented later ;HotKeySet("#zg", "Google") ; May be implemented later While 1 ; Infinite Loop - Keeps script running Sleep(100) ; Reduces the load this script places on processor time WEnd Func MagicClip() $currentclip = ClipGet() Send("^c") ; Copy $newclip = ClipGet() $newclips = $newclip & "|" & $newclips ; Generated with Form Designer preview, thanks lookfar GUICreate(" MagicClip", 404, 171, 433, 251, $WS_OVERLAPPEDWINDOW) GUICtrlCreateLabel("Magic Clip the following word / phrase:", 8, 8, 183, 13) $lbx_Clips = GUICtrlCreateList("", 8, 32, 185, 129, 0) GUICtrlSetData(-1, $newclips) $gbx_Clip = GUICtrlCreateGroup("gbx_Clip", 208, 24, 185, 105) $rdo_Define = GUICtrlCreateRadio("Define", 216, 48, 73, 17) GUICtrlSetState(-1, $GUI_CHECKED) $rdo_Google = GUICtrlCreateRadio("Google", 216, 72, 73, 17) $but_Go = GUICtrlCreateButton("Magic Clip", 264, 96, 75, 25) $but_Cancel = GUICtrlCreateButton("Cancel", 216, 136, 75, 25) $but_Exit = GUICtrlCreateButton("Exit", 312, 136, 75, 25) GUICtrlSetTip($but_Exit, "Exit Magic Clip") GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $but_Cancel ExitLoop Case $msg = $but_Exit Call ("Quit") Case $msg = $lbx_Clips $text = GUICtrlRead($lbx_Clips) MsgBox(0, "$lbx_Clips selected:", $text) GUICtrlSetData($gbx_Clip, $lbx_Clips) Case $msg = $but_Go $sDefine = GUICtrlRead($rdo_Define) $sGoogle = GUICtrlRead($rdo_Google) If $sDefine = $GUI_CHECKED Then Call ("define") EndIf If $sGoogle = $GUI_CHECKED Then Call ("Google") EndIf EndSelect WEnd ;Exit ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Sleep(5) ; Reduces the load this script places on processor time Wend GUIDelete() ClipPut($currentclip) EndFunc ;==> MagicClip Func define() ;$currentclip = ClipGet() ;Send("^c") ; Copy ;$newclip = ClipGet() Run("C:\Program Files\Internet Explorer\iexplore.exe http://dictionary.reference.com/search?q=" & $newclip) ClipPut($currentclip) EndFunc ;==> define Func Google() ;$currentclip = ClipGet() ;Send("^c") ; Copy ;$newclip = ClipGet() Run("C:\Program Files\Internet Explorer\iexplore.exe http://www.google.com/search?q=" & $newclip) ClipPut($currentclip) EndFunc ;==> Google Func Quit() Exit EndFunc ;==> Quit @Wouter, I know, it still makes you use IE, and you don't like that. I'll get to that later. @All, right now, I'm having trouble with some of the GUI functions. 1. I want the Group Box label to update when a 'word' is clicked in the list box... How can I do this? 2. My 'Cancel' button doesn't seem to work. I want the GUI to disapear, but the script to keep running. Thanks for your help, Comments welcome, Ian EDIT: Thanks lookfar for the GUI Builder, it's a big help. Edited October 3, 2005 by ioliver "Blessed be the name of the Lord" - Job 1:21Check out Search IMF Link to comment Share on other sites More sharing options...
ioliver Posted October 4, 2005 Author Share Posted October 4, 2005 (edited) Ok, here's the completed code: CODE; Magic Clip v2.au3 ; ; September 30, 2005 ; This script will allow you to define, or Goolge a word or phrase in the clipboard. ; Notes: ; # = Windows Key; ^ = Ctrl Key #include <GUIConstants.au3> Dim $currentclip Dim $newclip Dim $newclips Dim $text HotKeySet("#z", "MagicClip") ;HotKeySet("#zd", "define") ; May be implemented later ;HotKeySet("#zg", "Google") ; May be implemented later While 1 ; Infinite Loop - Keeps script running Sleep(100) ; Reduces the load this script places on processor time WEnd Func MagicClip() $currentclip = ClipGet() Send("^c") ; Copy $newclip = ClipGet() $newclips = $newclip & "|" & $newclips ; Generated with Form Designer preview, thanks lookfar GUICreate(" MagicClip", 404, 171, 433, 251, $WS_OVERLAPPEDWINDOW) GUICtrlCreateLabel("Magic Clip the following word / phrase:", 8, 8, 183, 13) $lbx_Clips = GUICtrlCreateList("", 8, 32, 185, 129, 0) GUICtrlSetData(-1, $newclips) $gbx_Clip = GUICtrlCreateGroup($newclip, 208, 24, 185, 105) $rdo_Define = GUICtrlCreateRadio("Define", 216, 48, 73, 17) GUICtrlSetState(-1, $GUI_CHECKED) $rdo_Google = GUICtrlCreateRadio("Google", 216, 72, 73, 17) $but_Go = GUICtrlCreateButton("Magic Clip", 264, 96, 75, 25) $but_Cancel = GUICtrlCreateButton("Cancel", 216, 136, 75, 25) $but_Exit = GUICtrlCreateButton("Exit", 312, 136, 75, 25) GUICtrlSetTip($but_Exit, "Exit Magic Clip") GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $but_Cancel ExitLoop Case $msg = $but_Exit Call ("Quit") Case $msg = $lbx_Clips $text = GUICtrlRead($lbx_Clips) GUICtrlSetData($gbx_Clip, $text) Case $msg = $but_Go $sDefine = GUICtrlRead($rdo_Define) $sGoogle = GUICtrlRead($rdo_Google) If $sDefine = $GUI_CHECKED Then Call ("define") EndIf If $sGoogle = $GUI_CHECKED Then Call ("Google") EndIf EndSelect WEnd GUIDelete() ClipPut($currentclip) EndFunc ;==> MagicClip Func define() ;$currentclip = ClipGet() ;Send("^c") ; Copy ;$newclip = ClipGet() GUIDelete() Run("C:\Program Files\Internet Explorer\iexplore.exe http://dictionary.reference.com/search?q=" & $text) ClipPut($currentclip) EndFunc ;==> define Func Google() ;$currentclip = ClipGet() ;Send("^c") ; Copy ;$newclip = ClipGet() GUIDelete() Run("C:\Program Files\Internet Explorer\iexplore.exe http://www.google.com/search?q=" & $text) ClipPut($currentclip) EndFunc ;==> Google Func Quit() Exit EndFunc ;==> Quit It works like I want it to now. Instructions: Once you start the script, select some text and use the shortcut Windows Key + z to run MagicClip. Let me know what you think. Ian Edit: Added the instructions. Edited October 4, 2005 by ioliver "Blessed be the name of the Lord" - Job 1:21Check out Search IMF Link to comment Share on other sites More sharing options...
rakudave Posted October 4, 2005 Share Posted October 4, 2005 i hate IE. why does everyone keep trying to make me use it.w0uter, wisely spoken! I just love your mentality!I use this! Pangaea Ruler new, UDF: _GUICtrlCreateContainer(), Pangaea Desktops, Pangaea Notepad, SuDoku, UDF: Table Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now