How to click on screen using coordinates

Asked by Max Musterman on 2018-01-18

Hello, I am new, I want to click on screen using coordinates.
I tried using the code in
But using Click(928,482) only clicks at the current mouse position.

If I set loc = 928,482
And use Click(loc)
It also only clicks at the current mouse position.

How do I get it to click at set coordinates?

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Last query:
Last reply:
Max Musterman (zegg) said : #2

Hi, thanks for you reply. I tried reading through what I could find before asking, but the problem is I have no programming knowledge so I don't understand much of it.

Do I need to define a location/region before using click? If so how do I do it? Can you maybe give me a link to a simple working script that I can copy paste that does a few clicks on the desktop so I can learn from it?

RaiMan (raimund-hocke) said : #3

Not sure, what you have read before.

There are tons of examples in the net and even tutorials.
So give it a try.

Nevertheless I recommend to at least read across the docs.

Max Musterman (zegg) said : #4

I am sure there are, but them existing doesn't help me if I cant find them, which is why I asked for a link. I found tons of stuff about relative coordinates or coordinates on an image or whatever, but nothing about just clicking a specific location.

I read the docs I found when I googled "sikuli click coordinates", like but they don't help me.

RaiMan (raimund-hocke) said : #5

clearly states, that it represents a location on the screen and how it is defined.
... and in the IDE there is a button, to define a Location

--- but they don't help me
If this is really your opinion, then you will not get happy with SikuliX.

Max Musterman (zegg) said : #6

After going through some other user scripts, the correct command is " click(Location(X,Y)) "

I don't understand why you didn't just answer my question. If you didn't care about my question, fair enough, don't reply but why reply just to give me misleading information? Are you keen on wasting both mine and your time?
Does not contain the command click(Location(X,Y)) which was the one and only thing I asked about.

Now you are probably going to think "It contains Location(x, y) so you could have concluded that..." No. I can't I have no idea about programming, I literally just tried to automate a few clicks while also using images. I don't care to learn about programming or computer science. The above command is literally all I wanted to know.

Anyways, my script works now, thanks for wasting our time.

RaiMan (raimund-hocke) said : #7

Good job.

... but I did not give you "misleading information" nor did I waste MY time.

Since I am not your servant, I did not WASTE YOUR time, but only expected, that you invest some time, what you finally did.

All the best.

Can you help with this problem?

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

To post a message you must log in.