Re: [Sikuli-driver] [Question #355875]: how to use FindAll in a loop

2016-08-23 Thread RaiMan
Question #355875 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/355875

Status: Open => Answered

RaiMan proposed the following answer:
--- I understand that the findAll function will return all locations of the 
images found
read: http://sikulix-2014.readthedocs.io/en/latest/region.html#Region.findAll

--- your code:

count = 0
findAll("checkbox")
for x in findAll("checkbox"): # apparently only one checkbox is found
while count < 5: # this loops 5 times with the same x
click(x)
count = count +1

--- how to use
checkboxes = list(findAll("checkbox")) # all found unsorted
print len(checkboxes) # get the number found
for box in checkboxes: # loop through all found
print box

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #355875]: how to use FindAll in a loop

2016-08-22 Thread Sander
New question #355875 on Sikuli:
https://answers.launchpad.net/sikuli/+question/355875

Hi!

findAll function is really nice, however I want to use it a bit of a different 
purpose.
I am trying to findAll checkboxes on screen, but only click a few of them.

I understand that the findAll function will return all locations of the images 
found 

count = 0
findAll("checkbox")
for x in findAll("checkbox"):
while count < 5:
click(x)
count = count +1

It actually works, but it clicks on the same location five times.
I've tried other functions, to use this loop, but these will return an error 
indicating that the object is not iterable.

Hope you could help me out.
Could not find an answer in an earlier raised question similar to this one, if 
the answer is there, hope you could link this page for me.

Thanks.



-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp