HeXetic Posted October 16, 2008 Share Posted October 16, 2008 I'm currently writing a script that will perform a restore using NTBackup. So far all is fine until I get to adding a new backup catalog. When you add a catalog there is about a 5 - 10 second wait before the program becomes responsive again. The problem is the script doesn't wait for this and makes the rest of the script useless. I can't use WinWaitActive because the backup window is always active. And I can't use WinWaitClose because nothing closes. I tried to use Opt("WinWaitDelay", 10000) but that didn't seem to work. The only other thing I can think of is a message box asking the user to click OK when ready to continue but I'd really rather not have that. $answer2 = MsgBox(4, "New Catalogue", "Do you want to add the new catalogue?") If $answer2 = 7 Then Exit Else Send("!t") Send("t") Send ("{ENTER}") ; Needs to wait here for about 10 seconds Send("{TAB}") Send("{DOWN}") Link to comment Share on other sites More sharing options...
Prab Posted October 16, 2008 Share Posted October 16, 2008 Try something like Sleep(10000). FolderLog GuiSpeech Assist Link to comment Share on other sites More sharing options...
Varian Posted October 16, 2008 Share Posted October 16, 2008 (edited) Just a thought, but while the window is unresponsive, can you drag it or change it's state(i.e. minimize, maximize)? I'm thinking you could use a loop to move it to specific coordinates, wait a second, and check if it has moved there. If it has not moved, it will sleep a second or two then restart the loop. You could try the same thing with minimizing or maximizing the window, waiting a second, and then checking the windows' state. Edited October 16, 2008 by Varian Link to comment Share on other sites More sharing options...
i542 Posted October 16, 2008 Share Posted October 16, 2008 $answer2 = MsgBox(4, "New Catalogue", "Do you want to add the new catalogue?") If $answer2 = 7 Then Exit Else Send("!t") Send("t") Send ("{ENTER}") Sleep(10000) Send("{TAB}") Send("{DOWN}") Just a thought, but while the window is unresponsive, can you drag it or change it's state(i.e. minimize, maximize)? I'm thinking you could use a loop to move it to specific coordinates, wait a second, and check if it has moved there. If it has not moved, it will sleep a second or two then restart the loop. You could try the same thing with minimizing or maximizing the window, waiting a second, and then checking the windows state.Hmm, good idea. I can do signature me. Link to comment Share on other sites More sharing options...
HeXetic Posted October 16, 2008 Author Share Posted October 16, 2008 Ah yes Sleep was exactly the function I needed. I tried searching for Pause, Delay, Wait but not Sleep. Thanks guys its working great now. 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