mwalkden Posted October 31, 2011 Posted October 31, 2011 $title = WinGetTitle("[CLASS:MozillaWindowClass]", "") While $title <> "Sign Out : Mozilla Firefox" Sleep(20000) $title = WinGetTitle("[CLASS:MozillaWindowClass]", "") WEnd After upgrading Firefox my code now hangs at Sleep(20000). The MozillaWindowClass has not changed (checked with info tool). Any help much thanks.
JohnOne Posted October 31, 2011 Posted October 31, 2011 While is working just fine, its a keyword at the heart of a language. What you need to do is some variable and error checking. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
vfear Posted October 31, 2011 Posted October 31, 2011 (edited) Try using:$title = WinGetTitle("[CLASS:MozillaWindowClass]", "") While Not $title = "Sign Out : Mozilla Firefox" Sleep(20000) $title = WinGetTitle("[CLASS:MozillaWindowClass]", "") WEndI haven't tested it but it should work. Edited October 31, 2011 by vfear
Malkey Posted October 31, 2011 Posted October 31, 2011 Try this. ; Info about Class obtained from running C:\Program Files\AutoIt3\Au3Info.exe ;or, ; SciTE > Tools menu > AU3Info ;#cs $title = WinGetTitle("[CLASS:MozillaUIWindowClass]", "") While $title <> "Sign Out : Mozilla Firefox" Sleep(2000) $title = WinGetTitle("[CLASS:MozillaUIWindowClass]", "") ;ConsoleWrite($title & @LF) WEnd ;#ce ;or ;When Mozilla Firefox window is closed, this running script ends. While WinExists("[CLASS:MozillaUIWindowClass]", "") Sleep(2000) ConsoleWrite("running" & @LF) WEnd Using the AU3Info tool, the window class of Mozilla Firefox is "MozillaUIWindowClass". And the class of the control existing on the Mozilla Firefox window is "MozillaWindowClass", The parameter ,"title", used in the WinGetTitle() and WinExists() functions is to do with the window, not a control.
mwalkden Posted October 31, 2011 Author Posted October 31, 2011 @Malkey, Thank you, your code works. However, My "Info about Class obtained from running Au3Info.exe" does not show me "MozillaUIWindowClass". I'm running Windows 7 64bit Ultimate and AU3 v3.3.6.1.
mwalkden Posted November 1, 2011 Author Posted November 1, 2011 Spoke too soon, now my script just goes past the while <> regardless so its not getting the correct info.
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