Sign in to follow this  
Followers 0
hmes

active script while ...

5 posts in this topic

#1 ·  Posted (edited)

Yea, command WinWaitActive starts my script if chosen window is activated but if same window is inactive it still works

Im looking for something that active my script ONLY if specified window is active and disactive if that window is closed or is inactive

Edited by hmes

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Have you tried If WinActive...?

Edited by Gestalt

Share this post


Link to post
Share on other sites

Look at this script from a few years ago. It concerns HotKeySet, but the same concept can be used for what you have in mind. It should give you some direction.

I think you forgot the link.

@OP: You mean something like this?

Local $sTitle = "Window title goes here"
While 1
    WinWaitActive($sTitle) ;wait untill window is active
    While WinActive($sTitle) ;run while the window is active
        ConsoleWrite("The script is running" & @CRLF)
        Sleep(1000)
    WEnd
    ConsoleWrite("The script is pauzed"& @CRLF)
WEnd

Share this post


Link to post
Share on other sites

If WinActive($Win) Then

blah blah blah

Else

Exit

EndIf

should work for you


00101101011110000101000001101100011011110110100101110100

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