mistrfree Posted May 20, 2005 Share 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?? Link to comment Share on other sites More sharing options...
flyingboz Posted May 21, 2005 Share 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. Link to comment Share on other sites More sharing options...
mistrfree Posted May 23, 2005 Author Share 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. 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