anybastard Posted March 15, 2010 Share Posted March 15, 2010 Hi Guys , this is a my first post on this forum . I need your help about a little problem with autoit script : My question is this I want run a program without user interactions , all work fine is my windows program is active but if my windows program is inactive my script doesn't work Below my last script $program = "C:\Program Files\my_program.exe" run ($program) Sleep (5000) if WinExists ("[CLASS:TForm3]") then ControlSend ("[CLASS:TForm3]","","",("!f")) ControlSend ("[CLASS:TForm3]","","","{DOWN} {DOWN} {DOWN} {ENTER}") EndIf Sleep (5000) if WinExists ("[CLASS:TFormSeekTest]") then ControlSend ("[CLASS:TFormSeekTest]","","","{TAB}{DOWN} {DOWN} ") ControlSend ("[CLASS:TFormSeekTest]","","","{TAB}") EndIf What are my mistake ?? Please , could you help me ??? Thank a lot AnyB Link to comment Share on other sites More sharing options...
omikron48 Posted March 15, 2010 Share Posted March 15, 2010 Do a WinActivate before you do ControlSend(s). In some cases, applications don't respond well unless they are the active window. Link to comment Share on other sites More sharing options...
anybastard Posted March 15, 2010 Author Share Posted March 15, 2010 Hi , first , thank for your prompt answer Yes , now all works fine !!! Thanks again Best Regards AnyB. Link to comment Share on other sites More sharing options...
anybastard Posted March 15, 2010 Author Share Posted March 15, 2010 (edited) AnyB. Edited March 15, 2010 by anybastard 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