xuzo Posted July 14, 2012 Posted July 14, 2012 (edited) My post title is not quite right let me reformulate:If window is there:show a pop to confirm it's thereIf window is not there:show a pop to say it's not thereI'm missing some very basic syntax to get this done. I'm missing something in the else, not sure what!Run("notepad.exe") Sleep(1000) If WinExists("[CLASS:Notepad]") Then MsgBox(0, "", "Window exists") EndIf Sleep(1000) WinClose("[CLASS:Notepad]", "") Send("!n") ;now the same steps but without Notepad being open Sleep(1000) If WinExists("[CLASS:Notepad]") Then MsgBox(0, "", "Window exists") ;ElseIf windows does not exit Then MsgBox(0, "", "Window Doesn't exist") EndIfThanks, Edited July 14, 2012 by xuzo
stormbreaker Posted July 14, 2012 Posted July 14, 2012 Try this: Run("notepad.exe") Sleep(1000) If WinExists("[CLASS:Notepad]") Then MsgBox(0, "", "Window exists") EndIf Sleep(1000) WinClose("[CLASS:Notepad]", "") Send("!n") ;now the same steps but without Notepad being open Sleep(1000) If WinExists("[CLASS:Notepad]") Then MsgBox(0, "", "Window exists") Else MsgBox(0, "", "Window Doesn't exist") EndIf ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1
stormbreaker Posted July 14, 2012 Posted July 14, 2012 This is working: Run("notepad.exe") Sleep(1000) If WinExists("[CLASS:Notepad]") Then MsgBox(0, "", "Window exists") Else MsgBox(0, "", "Window Doesn't exist") EndIf ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1
xuzo Posted July 14, 2012 Author Posted July 14, 2012 Hi MKISH, This works 100%, thank you so much! However, I'm trying to control the script so the pop ups don't come up to quickly, seems like they sometimes make the sound before the pop up shows... up... It there a way to pace things a little better without sleeps of X millisecondes in between steps?
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