MacOS – How to make a colour clicker using AppleScript

applescriptcolormacosmouse

How can AppleScript be used to make the mouse cursor search for a colour on the screen and click on it when found and return to its starting position after?

How to make a script that can do this process:

  1. define a colour by selecting it from a screenshot
  2. search on that defined colour and click it then return back to starting position

Best Answer

Consider using Sikuli to implement your task rather than AppleScript:

Sikuli automates anything you see on the screen. It uses image recognition to identify and control GUI components. It is useful when there is no easy access to a GUI's internal or source code.