Mechaflash Posted February 2, 2012 Share Posted February 2, 2012 I know this function exists... cause I remember seeing it.. but looking at the function list twice, I missed it both times. What's the function to check for a window (by name of window), and also conditionally pause the script until the window terminates? Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
Guest Posted February 2, 2012 Share Posted February 2, 2012 (edited) This is what you are looking for. WinWaitClose ( "title" [, "text" [, timeout]] ) which can be found @: Function Reference > Window Management Edited February 2, 2012 by Guest Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 2, 2012 Moderators Share Posted February 2, 2012 (edited) Hi, Mechaflash213, I believe you're looking for WinExists. Something like this maybe? While WinExists("Untitled", "") MsgBox(0, "", "Yep!") Sleep(1000) WEnd Edit: more than one way to skin a cat. Aipion's works as well Edited February 2, 2012 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Mechaflash Posted February 2, 2012 Author Share Posted February 2, 2012 Thanks Aipion and JLogan for the quick reply. @Aipion would it matter that it's not checking for the window first, and just carrying out the command? Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 2, 2012 Moderators Share Posted February 2, 2012 (edited) It does do a check, if the window does not exist when it checks, it simply moves on to the next command. WinWaitClose("Untitled", "") MsgBox(0, "", "Gone") If the window does not exist, it will go right to the Message Box. If the window does exist, it will pause until the window is closed. Edited February 2, 2012 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Guest Posted February 2, 2012 Share Posted February 2, 2012 I would say make sure the window Exists with WinExists then go with WinWaitClose. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 2, 2012 Moderators Share Posted February 2, 2012 (edited) The difference is really in what you want to do. Using a While statement with WinExists, you can do other stuff while you wait for the window to close. With WinWaitClose, however, the script pauses completely until that condition is met. Edited February 2, 2012 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Mechaflash Posted February 2, 2012 Author Share Posted February 2, 2012 I have a good one for you: how do you check it by the Class of the window? Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 2, 2012 Moderators Share Posted February 2, 2012 While WinExists("[CLASS:Notepad]", "") MsgBox(0, "", "Yep!") Sleep(1000) WEnd "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted February 2, 2012 Share Posted February 2, 2012 I have a good one for you: how do you check it by the Class of the window?Why don't you follow the "Title special definition" link in helpfile and find out? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Guest Posted February 2, 2012 Share Posted February 2, 2012 (edited) Code the script like this: While 1 Sleep(100) If WinExists("title", "") = 1 Then ExitLoop WEnd WinWaitClose ( "title" , "" ) This Code will check if the window Exists then it will wait until it terminates. Edited February 2, 2012 by Guest Link to comment Share on other sites More sharing options...
Mechaflash Posted February 2, 2012 Author Share Posted February 2, 2012 @Admiral. Sorry, I overlooked the link in the documentation. I'll make sure to be a perfect robot and not make a human mistake, like overlooking a detail, next time. Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted February 2, 2012 Share Posted February 2, 2012 @mechaflash213 Sounds like a good plan .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface 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