Jump to content

Window Counter

Recommended Posts


I am new to scripting and only have only  very limited programming knowledge. What I want to do is create a script that will loop through the open windows of a programm and when the window count is <4 the script should open another window.

The following lines work for the title:

opt("WinTitleMatchMode", 2)
$j = 0
$winlist = WinList()
for $i = 0 to $winlist[0][0]
if stringinstr($winlist[$i][0], "abc") then
    $j = $j + 1

I pretty much need something like this but for "CLASS:" as identfier since the title isnt specific enough. 

Share this post

Link to post
Share on other sites

Hi and welcome!

I would take a look at the Window Titles and Text (Advanced) section of the help file.

; Checks if a window with these properties exists:
;  - RegExpTitle: the title matches .*abc.* (something abc something)
;  - Class: matches your class
;  - Instance: it's the fourth matching window

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

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

  • Create New...