How to handle multiple instances of a particular image? --- not a feature

Asked by Karthik

I have multiple varieties of button 'OK' in my project. How to capture all those images under a single folder name called "Button_Ok"?

Is there any functionality in Sikuli through which I can have multiple instance of an image under a single folder? I want to use that single folder name to click an image, which inturn will find any one of the image inside that folder.

Example:
click("Button_Ok")

Image Repository:
Folder Name: Button_Ok
Folder Contents: buttonok1.png
                                  buttonok2.png
                                  buttonok3.png

Any solution please?

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

not a feature.

you have to implement a solution yourself (similar to your other question https://answers.launchpad.net/sikuli/+question/175411)

But I would not recommend to use folders (too complicated), use suffixes instead.

e.g. having these images

buttonok1.png
buttonok2.png
buttonok3.png

def getAllImages(beginText):
    # some dir/file name handling code (e.g. os.listdir() )
    # that builds a list of all images beginning with beginText
    return listFoundImages

and then use this function in other function calls like click any(getAllImages("buttonok")).

Revision history for this message
RaiMan (raimund-hocke) said :
#2

again feel free to post a request bug.

Can you help with this problem?

Provide an answer of your own, or ask Karthik for more information if necessary.

To post a message you must log in.