Jump to content

Recommended Posts

Posted

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.”

 

Posted (edited)

This is what you are looking for.

WinWaitClose ( "title" [, "text" [, timeout]] )

which can be found @: Function Reference > Window Management

Edited by Guest
  • Moderators
Posted (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 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!

Posted

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.”

 

  • Moderators
Posted (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 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!

Posted

I would say make sure the window Exists with WinExists then go with WinWaitClose.

  • Moderators
Posted (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 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!

Posted

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.”

 

Posted

@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.”

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...