Quantcast
Channel: Adobe Community: Message List - Photoshop Scripting
Viewing all articles
Browse latest Browse all 27456

Re: Selecting the brightest pixels

$
0
0

The name alone is not enough, you need to define the Channel.

For example

activeDocument.channels[activeDocument.channels.length - 1]

signifies the last Channel.

activeDocument.channels[0]

the first (in an RGB image the red one).

If you want to select a Channel based on its name use

activeDocument.channels.getByName(/* insert the name here */)

 

But to avoid having to write activeDocument over and over again one usually does something like

var theDoc = app.activeDocument

and subsequently uses the variable (in this case called "theDoc").

 

And yes, the parts between "/*" and "*/" are comments that do not perform as code.

Another way to comment something out is to start a line with "//".


Viewing all articles
Browse latest Browse all 27456

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>