send image as parameter to a function

Asked by ilan

Hello,
This is my first experience with sikuli , so far having fun with it.

I would like to write a simple function that accept an image as parameter and use it in function for simple task like click.
it sounds like an easy task to accomplish but can get it run.

should be somthing like:

def doSomthing(image):
     image.click( ) # or any other command to click this object on screen
     return;

doSomthing("xyz.png")

Please help
il

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

An "image" given as png-file-name cannot be "clicked".

Only the match (region) where it is found can be clicked at the center:

def doSomthing(image):
     click(image) # or any other command to click this object on screen
     return;

doSomthing("xyz.png")

consult the docs to learn about the many options:
http://sikulix-2014.readthedocs.io/en/latest/index.html

Can you help with this problem?

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

To post a message you must log in.