• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: if if if Pfft!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: if if if Pfft!


  • Subject: Re: if if if Pfft!
  • From: Paul Skinner <email@hidden>
  • Date: Tue, 20 May 2003 14:50:20 -0400

On Monday, May 19, 2003, at 10:27 PM, Shane Stanley wrote:

On 20/5/03 11:14 AM +1000, Paul Skinner, email@hidden, wrote:

tell application "Adobe Photoshop 7.0"
set documentMode to mode of document 1
if documentMode is CMYK then set channelCount to 4
if documentMode is in {RGB, Lab} then set channelCount to 3
if documentMode is grayscale then set channelCount to 1
end tell

Isn't there a smart way to do this? I can't recall, but I thought I
knew a way to do this as a single statement.

You should really be using "else if"s in that, but I think what you're
looking for is:

tell application "Adobe Photoshop 7.0"
tell current document
set channelCount to count of (get component channels)
end tell
end tell


--
Shane Stanley, email@hidden

Thanks Shane, that is what I need to use. That resolves all cases.

But it's not the method I was thinking of. Maybe I was thinking of using offset to do a kind of hash. yuck.

Paul Skinner
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: if if if Pfft! (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: New!!!
  • Next by Date: Scripts for scripters
  • Previous by thread: Re: if if if Pfft!
  • Next by thread: Re: if if if Pfft!
  • Index(es):
    • Date
    • Thread