Jump to content

active script while ...


hmes
 Share

Recommended Posts

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
Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...