Photoshop 7 - how to identify a document's channels?

Hi -

I would like to have a variable in my script containing the number of channels in a document opened in Photoshop 7. For example, if the document is RGB, it would have 3 channels. CMYK would have 4. And, if the document had additional alpha channels (whether they were renamed or not) I would like my variable to contain that information.

I’ve been looking in the dictionary, and I saw a similar post here on the forum, but it wasn’t exactly what I was looking for. The post on the forum showed how to delete extra channels.

Here’s what I’ve been thinking:

tell application "Adobe Photoshop 7.0"
                 set chanNum to every channel in current document
          end tell

Each time I do this, I get an error saying that the document does not understand the class.
Does anybody know how to correct this?

Sorry - still pretty new at this, thanks for the help!

-Derek

Try this:

tell application "Adobe Photoshop 7.0"
	set chanNum to count channels in current document
end tell

Thanks Carl. I tried that finally and it worked great. That was the missing piece I needed before I could get my script to continue.

Thanks again!