Caterpillar Posted April 19, 2007 Share Posted April 19, 2007 Hi, I'm a newby with AutoIT3. My script works fine as long as the windows is active. If another window becomes on top my script fails. How can I fix this? Link to comment Share on other sites More sharing options...
Generator Posted April 19, 2007 Share Posted April 19, 2007 Maybe use ControlSend()? Link to comment Share on other sites More sharing options...
Caterpillar Posted April 19, 2007 Author Share Posted April 19, 2007 Here is the simple script: ============ RUN("C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\ssmsee.exe c:\sqlbackup\CAM2000_backup.sql") WinWaitActive("Connect to Database Engine", "") sleep(500) Send("{ENTER}") sleep(500) Send("!x") sleep(15000) Winclose("Microsoft SQL Server Management Studio Express") ============ It fails sometimes at WinWaitActive. How ControlSend() help me with this then? Link to comment Share on other sites More sharing options...
pantone Posted April 20, 2007 Share Posted April 20, 2007 I had same problem in this topic. I hope someone reply us if resolved this. thanks Link to comment Share on other sites More sharing options...
MHz Posted April 20, 2007 Share Posted April 20, 2007 It fails sometimes at WinWaitActive. How ControlSend() help me with this then?You could try this. Run('"' & @ProgramFilesDir & '\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\ssmsee.exe" c:\sqlbackup\CAM2000_backup.sql') WinWait("Connect to Database Engine") sleep(500) ControlSend("Connect to Database Engine", "", "", "{ENTER}") sleep(500) ControlSend("Connect to Database Engine", "", "", "!x") sleep(15000) Winclose("Microsoft SQL Server Management Studio Express") Since I see a alt-x being used, meaning that it is a gui application, then you can use ControlClick() to press buttons and checkboxes. Link to comment Share on other sites More sharing options...
pantone Posted April 23, 2007 Share Posted April 23, 2007 It's much help for me~ thank you for your help You could try this. Run('"' & @ProgramFilesDir & '\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\ssmsee.exe" c:\sqlbackup\CAM2000_backup.sql') WinWait("Connect to Database Engine") sleep(500) ControlSend("Connect to Database Engine", "", "", "{ENTER}") sleep(500) ControlSend("Connect to Database Engine", "", "", "!x") sleep(15000) Winclose("Microsoft SQL Server Management Studio Express") Since I see a alt-x being used, meaning that it is a gui application, then you can use ControlClick() to press buttons and checkboxes. 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