Is there a way to use Contiguous Select from a script

The only thing I’ve found for the Contiguous Select tool is to use an action and trigger, but there doesn’t seem to be a way to tell it where to start the selection. Something like contiguousSelect(x, y, threshold) would be nice. Or maybe there is and I missed it. Any help is appreciated.

The only way is to simulate a click. Otherwise, you do it manually by reading the pixeldata of the layers/document and then setting the pixeldata of the selection

Is there a way to simulate a click?

How would using the pixeldata work for a contiguous selection? The only thing I can think of would be to iterate through all the pixeldata and add any pixels that match the initially selected pixel to the selection. But then how do I check whether it’s contiguous?

Here is a script that simulates a click. You can paste it into the scripter and run it.

1 Like