Winlist inconsistent returned values

Recommended Posts

Cusem 1

Cusem 1

I'm quite a n00b with AutoIT3, but I find it very helpful to automate certain processes.

I'm having some trouble with the WINLIST function.

I'm trying to repeat a process until the script has opened 8 windows of a certain program.

In the process, A window gets opened Which has name like "Tournament 414323435.......". Automatically another windows is opened that's called "Tournament 414323435 Tracker".

So by running the process once, 2 windows are opened which comply to the WinList("Tournament","").

In total I'd like to open 8 sets windows as described above. That's why I think While $count<16 would work.

However, the data returned by $listcount[0][0] is very inconsistent. When no "Tournament" window is open, it returns 1. When I've got 16 windows open with "Tournament in the title", it returns 25. However, these number are very inconsistent.

Anybody knows what I am doing wrong or how i can resolve this problem?

WinList returns an array ($listcount). Your problem is, that you are using $listcount as the counter value AND the window list array. That won't work, right?

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post

Link to post

Share on other sites

Cusem 1

Cusem 1

At first I forgot to copy to [0][0] after the "While $listcount<16" (sorry for that). The correct line is "While $listcount[0][0]<16"

$listcount[0][0] returns the number of windows found doesn't it?

Since I want it to open 16 windows, my goal was to repeat the process until 16 Windows are opened, but this doens't work the way I try to do it?

Is there maybe another command I can use to get an integer value on how many windows are open with "textstring" in the title?

Because the values that I get with $listcount[0][0] are very inconsistent. I looked at the applications running and running processes in the Task Manager, but I don't seem to find the number that I get from $listcount[0][0].

I'm going to look into the helpfile about that "visible" thing. I'm not really farmiliar with that.