Damastah Posted August 12, 2009 Share Posted August 12, 2009 I'm running a script to automate certain tasks on my computer. It's uses Windows Explorer, so I'm using WinWait("") and ControlSend("", "", 0, "However many tabs and enter...") to navagate. Here's the problem. When the window appears, the script continues regardless if the window has fully loaded or not. This is not good for slow computers because the tabs wont work until the window is loaded and responding. How can I get around this? I'm using Windows Vista and trying to navigate through Control Panel Applets. For Example "Manage Network Connections" in the Network Connections and Sharing Center. Link to comment Share on other sites More sharing options...
billthecreator Posted August 12, 2009 Share Posted August 12, 2009 put a sleep() in there [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap Link to comment Share on other sites More sharing options...
JSThePatriot Posted August 12, 2009 Share Posted August 12, 2009 Have you tried something along the lines of...If Not WinExists("Some Window") Then WinWait("Some Window"). I usually play around with the different functions till I find a combination that works. Sometimes you can even add a Sleep() call in there to assist it in waiting. You could also use...WinWaitActive(), or WinWaitNotActive(). I hope this helps some, Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Damastah Posted August 12, 2009 Author Share Posted August 12, 2009 I did put a sleep in there. but I want this script to run as fast as possible and the sleep times aren't the same for different computer speeds. And the window exists before it loads so the WinWait() command is limited in this situation... Link to comment Share on other sites More sharing options...
billthecreator Posted August 12, 2009 Share Posted August 12, 2009 (edited) find the control that appears last when its open then do a while ControlGetHandle("the window name", "", "control") = "" sleep(100) wend then do you stuff here Edited August 12, 2009 by billthecreator [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap Link to comment Share on other sites More sharing options...
Damastah Posted August 12, 2009 Author Share Posted August 12, 2009 (edited) find the control that appears last when its openthen do a while ControlGetHandle("the window name", "", "control") = ""sleep(100)wendthen do you stuff hereOOH! Interesting. Thanks. I'll try it.EDIT: I ended up using ControlCommand() and the IsVisible option to sleep until it returned true. Edited August 12, 2009 by Damastah 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