What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Scripting Script - find area of white pixels on row?


buzzwig

New Member
Messages
3
Likes
0
I've automated a job I have to do frequently. They are puzzles for the newspaper, which are always the same width, but vary in depth. My AppleScript finds the large number of white pixels in a row of pixels, which indicates the bottom of the puzzle. It's a crazy kluge.

What I have is an AppleScript I wrote that uses DigitalColor Meter (Macintosh) to copy the values of the pixels under the cursor's current location which I have ascending up from the bottom of an image by 4 pixels at a time in a repeat loop. It finds a white pixel and increments the variable (i). If the variable is up to 30, the cursor clicks and selects a single pixel which I can get the location of so that I have coordinates for a crop.

What I want is a Javascript that will do the job much, much faster and more reliably. Does anyone have ideas? I have only worked in AppleScript at this point. I'd like to get into JavaScript for Photoshop too.
 

Top