Sign in to follow this  
Followers 0
Tulos

If window is not active then exit

2 posts in this topic

Would or should this work?

//////////

WinWait("Program Name","")

If Not WinActive("Program Name","") Then WinActivate("Program Name","")

WinWaitActive("Program Name","")

Sleep (5000)

If Not WinActive("Program Name","") Then Exit

/////////

I ask because sometimes the program the script is to run in closes but the script continues to run and thus creates a mess on my desktop lol

Thanks

Huserx

Share this post


Link to post
Share on other sites



. . . sometimes the program the script is to run in closes but the script continues to run and thus creates a mess on my desktop . . .

Try something like the below example. Also search the Help file for WinWait() and WinExists() for more information.

WinWait("Program Name", "", 3)
If WinExists("Program Name", "") Then
    If Not WinActive("Program Name", "") Then WinActivate("Program Name", "")
    WinWaitActive("Program Name", "")
    Sleep(5000)
Else
    Exit
EndIf

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0