Ali
Ali

Reputation: 1436

How to make a click with a mouse to a specific position on a mac?

Given dynamic (meaning those could change in time) x, y coordinate values of your screen how to make an actual click programmatically on that point (or via automator, or anything else for that matter) on a mac?

Upvotes: 0

Views: 6122

Answers (3)

John Dorian
John Dorian

Reputation: 1904

I know this is an old thread, but I wanted to post an answer just in case anybody stumbles upon this.

There's a new completely platform independent automation language called javAuto. It's pretty much a java program the can compile and run your code cross platform.

The syntax is almost exactly like the popular automation language AutoIT.

For simulating a mouse click you can use this command:

mouseClick(button, x, y);

Example:

//click in the center of the screen
mouseClick("left", SCREEN_WIDTH/2, SCREEN_HEIGHT/2 );

Upvotes: 0

f01
f01

Reputation: 1856

Cliclick with loop:

$ for ((i=0; i<=60; i++)); do cliclick -r w:1000 c:297,256 c:381,255; done

Upvotes: 0

Ali
Ali

Reputation: 1436

I have found two neat solutions to this problem:

  1. is a command line utility called Cliclick
  2. is a pretty neat IDE and a bonus scripting language called Sikuli

Upvotes: 2

Related Questions