Jump to content

Simple create url script, why doesn't it work?


remin
 Share

Recommended Posts

I created this little script:

HotKeySet("!g", "searchgoogle")

While 1
    Sleep(10000)
WEnd


Func searchgoogle()
   Sleep(500)
   Send( "^c" )
   Sleep(500)
    $ClipB2 = ClipGet()
    $url = "http://www.google.com/search?q=" & $ClipB2
    Sleep(300)
    MsgBox(0,"",$url)
EndFunc

I just select a word and invoke the hotkey.

More than an hour I try to change the Sleep values but something still does not work:

When I invoke the 1st time the hotkey, almost always it returns the correct url,

but when I reuse the hotkey a few times it doesn't copy any more and the url

is constructed with previous clipboard value.

Does anyone know what is wrong in my script?

Edited by remin
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...