mouse move to color

I would like the mouse to move to a particular color on the screen and then right click it. It would have to first search the screen and find the location of that color and then move the mouse to that location. Is this possible?

I highly doubt it.

You’re better off telling us what you really trying to do. Some sort of status complete. What is the color representing.

Or

UNIX Screencapture command
Photoshop pixel by pixel scan
A week later
CE Quickkey - macro software for the right click

Mad but it might work

Have Fun

I imagine you could write an applescript to take a desktop picture of your screen, then process the picture with a photo application looking for you color values, and when found return the coordinates of that pixel, which would be the coordinates on your screen where you want to put the mouse, and then use gui scripting to move the mouse pointer.

Basically it is scripting a function in a game. At a random location on the screen a bobber appears. When the bobber splashes (changes pixel color for the splash) on screen it is required to right click the bobber and then rinse and repeat. I have done some image processing at my work before and can find the pixel location using a screen capture and image processor however how do you input the location data into applescript from the image processor?

two ways…

  1. if the image processor is scriptable then you can look at the dictionary for it and see what commands will transfer the data or
  2. copy the location data to the clipboard and then in applescript read the clipboard like so:
set location_data to the clipboard

Ok I can now output the screen shot to an image processor however the data does not go to the clipboard. The x,y location of the desired color is sent to a text document. Is there a way applescript can read the data in the text document and put the data into a variable?

try this…

set file_contents to read (choose file)
set text item delimiters to “,”
set contents_list to text items of file_contents
set text item delimiters to “”
set xPosition to item 1 of contents_list
set yPosition to item 2 of contents_list

maybe its possible to have system events scan the screen for color code X and click in that position?