I want to get the color properties of a selected area of an image in Photoshop CS. Although PS is highly scriptable, it doesn’t allow access to properties of a selected area so I’ve resorted to using “System Events.” Unfortunately, that doesn’t seem to work either. Or is there a way?
I figured by activating the eyedropper tool then clicking on the photo image at a chosen location that it would make the foreground color change to match the clicked area. And, since the “foreground color” is easily accessed I’d have my information.
Here’s the simple script that works except for the “click at” portion. (I’m aware that the x,y, click coordinates shown below are outside the selected area but the click is arbitrary for now. It could just as easily be {10, 10}). Do I need to do something different to click the mouse at a specific location on the photo? Or better, is there a way to “get” the color info at specific areas?
tell application "Adobe Photoshop CS"
activate
tell current document
select region {{0, 0}, {20, 0}, {20, 20}, {0, 20}}
tell application "System Events"
tell process "Adobe Photoshop CS"
keystroke "i" --activates the eyedropper tool
click at {800, 800} --SHOULD MAKE THE EYEDROPPER CLICK AT AN {X, Y} LOCATION BUT DOESN'T!!!
end tell
end tell
end tell
end tell
Thanks,
BD
Model: G5
Browser: Safari 412.2
Operating System: Mac OS X (10.4)