• 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: Shane Stanley <email@hidden>
  • Date: Tue, 20 May 2003 12:27:35 +1000

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
_______________________________________________
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.

  • Follow-Ups:
    • Re: if if if Pfft!
      • From: Paul Skinner <email@hidden>
References: 
 >if if if Pfft! (From: Paul Skinner <email@hidden>)

  • Prev by Date: Re: if if if Pfft!
  • Next by Date: Cascade or Tile Finder windows
  • Previous by thread: Re: if if if Pfft!
  • Next by thread: Re: if if if Pfft!
  • Index(es):
    • Date
    • Thread