Sign in to follow this  
Followers 0
Cusem

Winlist inconsistent returned values

4 posts in this topic

Hello,

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?

-

-

Opt("WinTitleMatchMode", 2)

$listcount=0

While $listcount<16

$listcount = WinList("Tournament","")

-=[PROCESS TO OPEN A NEW WINDOW]=-

WEnd

-[END CODE]-

Share this post


Link to post
Share on other sites



-

-

Opt("WinTitleMatchMode", 2)

$listcount=0

While $listcount<16

$listcount = WinList("Tournament","")

-=[PROCESS TO OPEN A NEW WINDOW]=-

WEnd

-[END CODE]-

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

don't see you use $listcount [0][0] as counter in the snippet posted, but its easy to find out what windows were found by listing them and checking if they are visible or not .....


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thanks for the replies.

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.

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