Finding a color and saving it's value in an application window?

Hey, I’m new to Applescript and was curious to know how to go about looking for a color within a bounding box area and saving those values of coordinates found?

Example:

I specify a range of pixels, say, (100,100) to (400,400) to look for a color value of…oh, I don’t know, C30B02 red.
I then return the coordinates of where that color was found, using Xtool, so the command would be return position of the mouse except for color.
And then save those coordinates for use later on in the script, to move the mouse to location.

I know that seems like a lot to cover, but knowing some Actionscript3, I feel like there should be some commands that I can’t find to return this info. Where do I start? :frowning:

Do you have developer tools installed? If so there’s an application called Pixie that shows color values among other things. You have to go into the preferences and check the box to show them because they’re not on by default. I don’t know how to script Pixie but maybe it will help you. Find it in /Developer/Applications/Graphics Tools/

Yodan,

This will get your mouse location. There are other commands
to move your mouse, click, double-click, etc.

Extra Suites is an osax that you can find here.
http://osaxen.com/files/extrasuites1.1.html

Regards,

Craig

set myLoc to my getMouseLocation()

on getMouseLocation()
	tell application "Extra Suites"
		set mouseLoc to (ES mouse location)
	end tell
	return mouseLoc
end getMouseLocation