laphlaw Posted June 22, 2005 Share Posted June 22, 2005 Okay, keep in mind I'm a newb, and I don't really have any scripting or programming background. With that out of the way... I'm starting to experiment with building a GUI. What I want to do is create a function that will take a variable and search Google with it. I know how I could manually do it, but I want to do it the fastest way, or "right" way. What would be the best way to do this. Here's what I have so far: func googlesearch() run("C:\Program Files\Mozilla Firefox\firefox.exe") WinActivate("Mozilla Firefox") WinWaitActive("Mozilla Firefox") sleep(100) send(guictrlread($input_1)) <------- this is my variable send("{enter}") Exit EndFunc now I know there's a far better way to do this... I just don't know how. How can I directly search google w/o manually running my web browser, sending the variable, then sending {enter}? Also... is there a command that pauses the script until a webpage has loaded? Link to comment Share on other sites More sharing options...
laphlaw Posted June 23, 2005 Author Share Posted June 23, 2005 Please help! I've done some searching on this forum, but haven't found an answer to my problem. Can anyone help me? Link to comment Share on other sites More sharing options...
MarkMarkMark Posted June 23, 2005 Share Posted June 23, 2005 (edited) $yourvar = ( inputbox.. blabla.....) func googlesearch() run("C:\Program Files\Mozilla Firefox\firefox.exe [url=http://www.google.nl/search?biw=1024&hl=nl&q=]http://www.google.nl/search?biw=1024&hl=nl&q=[/url] & $yourvar & &btnG=Google+zoeken&meta=") EndFunc lol, really dont know if something like this works... try it out.. didnt test tbh Edited June 23, 2005 by MarkMarkMark Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted June 23, 2005 Share Posted June 23, 2005 $string = "AutoIt Scripting Language" $sString = StringReplace($string, " ", "+") run(@Comspec & '/c start www.google.com/search?q=" & $sString, "", @SW_HIDE) that should do it for you Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
laphlaw Posted June 23, 2005 Author Share Posted June 23, 2005 $string = "AutoIt Scripting Language"$sString = StringReplace($string, " ", "+")run(@Comspec & '/c start www.google.com/search?q=" & $sString, "", @SW_HIDE)that should do it for you<{POST_SNAPBACK}>I couldn't get it to work -- the debugger said "Unable to execute the external program.: run(@Comspec & "/c start www.google.com/search?q=" & $sString, "", @SW_HIDE)"btw: what does the "@Comspec" and /c do? Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted June 24, 2005 Share Posted June 24, 2005 It's starts the default command line interpreter (either cmd.exe or command.com) and runs the command entered. Once finished executing, the '/c' closes the command line. Start ... opens the file/hyperlink in the default associated program. start myfile.doc That should open the Word Document in MS Word (if installed), and if the file exists. Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
w0uter Posted June 24, 2005 Share Posted June 24, 2005 the udf in my sig can do google searches. 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...
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