pa18 Posted January 9, 2009 Posted January 9, 2009 Wow, this is all new to me but it looks like I need a steep learning curve. What I would like to do is to run a script so that the script will select an already opened window from my desktop GUI and press enter. Can AutoIt do this? If so, then how can I do this? Thank you for your time.
Innovative Posted January 9, 2009 Posted January 9, 2009 Search WinActivate and Send from the help files .
Andreik Posted January 9, 2009 Posted January 9, 2009 Wow, this is all new to me but it looks like I need a steep learning curve.What I would like to do is to run a script so that the script will select an already opened window from my desktop GUI and press enter.Can AutoIt do this? If so, then how can I do this?Thank you for your time.Yes, AutoIt can do that. Read in help file about WinActivate() and Send() functions.
pa18 Posted January 9, 2009 Author Posted January 9, 2009 that was quick! Thanks both, let me have a look and see if I can handle it
argumentum Posted January 9, 2009 Posted January 9, 2009 (edited) that was quick! Thanks both, let me have a look and see if I can handle it$vString = "Untitled - " While Not WinExists($vString) ;~ GUIGetMsg() ; <--- this is as fast as posible Sleep(1000) ; <--- this sleeps for a second WEnd WinActivate($vString) Send("{Enter}")oÝ÷ Ú+!j·mçâ®Ëlr¸©¶z&jÛ^®0²)©è$°z)zz-¶Zz»¢*.û§Øjëh×6$vString = "Untitled - " WinWait($vString) WinActivate($vString) Send("{Enter}") I like my first example, if you wait a sec (1000 milli sec.), it uses a lot less CPU Edited January 9, 2009 by argumentum Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
pa18 Posted January 9, 2009 Author Posted January 9, 2009 So I have this: WinActivate "title" [, "text"] Send "keys" [, flag] I've been trying to understand it but I get an error surprise surprise (Error Parsing Function Call). So if I have a window call AutoItX Help. I substitute the above for the following: WinActivate "AutoItX Help" since the second part is optional, I can omit [, "text"] Then: Send "{ENTER}" The second part is optional so just omit [, flag] Also, after pressing send how do I minimize the window again? I think it is this one: WinSetState "title", "text", flag
pa18 Posted January 9, 2009 Author Posted January 9, 2009 Whoops argumentum, I just posted my dumb attempt at programming . Yours look very professional so let me run yours and see. Thanks!
Andreik Posted January 9, 2009 Posted January 9, 2009 If you want to send enter for a window that is minimize you can use ControlSend() like in this example: AutoItSetOption("WinTitleMatchMode",2) HotKeySet("{SPACE}","SendEnter") ;Press SPACE to send an ENTER to Notepad HotKeySet("{ESC}","Quit") ;Press ESC to exit Run("notepad",@SystemDir,@SW_MINIMIZE) WinWait("Notepad") While 1 Sleep(25) WEnd Func SendEnter() ControlSend("Notepad","","Edit1","{ENTER}") EndFunc Func Quit() Exit EndFunc
pa18 Posted January 9, 2009 Author Posted January 9, 2009 Wow you guys really know how to spoil someones fun don't you. OK, THIS TIME ONLY, I will copy and paste Thanks guys!
argumentum Posted January 9, 2009 Posted January 9, 2009 Wow you guys really know how to spoil someones fun don't you. OK, THIS TIME ONLY, I will copy and paste Thanks guys!lol, the way I got "the hang of it", was by copy, paste and modify what I've found in the forum and in the help file.I should go to sleep now, take care. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
Bert Posted January 9, 2009 Posted January 9, 2009 Take a look at AutoIt 1 2 3 in my signature. It will teach you LOADS of stuff! The Vollatran project My blog: http://www.vollysinterestingshit.com/
pa18 Posted January 10, 2009 Author Posted January 10, 2009 Thank you all, this seems like a nice community and AutoIt seems like a nice app to play around with. Volly, when I get some time I will have a look closer. Thank you for directing me there!
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