mistrfree 0 Posted May 20, 2005 OK. I have a problem trying to get user input from an external program. I am trying to find when a user selects a button. I need to get this input and pass it in my autoit script within in a If Then Else. I have read, but to no avail. I am assuming that a ControlGetFocus might do the trick? Any Ideas?? Share this post Link to post Share on other sites
flyingboz 2 Posted May 21, 2005 OK. I have a problem trying to get user input from an external program. I am trying to find when a user selects a button. I need to get this input and pass it in my autoit script within in a If Then Else. I have read, but to no avail. I am assuming that a ControlGetFocus might do the trick? Any Ideas??<{POST_SNAPBACK}>You need to put your test condition in a loop, i.e.:while $id <> $desired_control_id $id = ControlGetFocus("name or variable of desired window") sleep(1); necessary for cpu util issues Wendnow you know that the control is activeso you can do stuffif you need to test multiple controls, use a while loop and then call functions for your hits based off of a select / case / end select group.... I find this to be easier to debug than a big bunch of nested if /else blocks.Don't be afraid to try simple test cases that can answer your own question in a matter of seconds.... Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Share this post Link to post Share on other sites
mistrfree 0 Posted May 23, 2005 Thanks for the info. With a bit of trial and error, I have it working flawlessly!!! Thanks again for your help. Share this post Link to post Share on other sites