• 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: Michelle Steiner <email@hidden>
  • Date: Mon, 19 May 2003 19:17:29 -0700

On Monday, May 19, 2003, at 06:14 PM, Paul Skinner 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.

Well, technically, using else in that construct makes it a single statement.

if documentMode is CMYK then
set channelCount to 4
else if documentMode is in {RGB, Lab} then
set channelCount to 3
else if documentMode is grayscale then
set channelCount to 1
end if

--Michelle

--
"My country, right or wrong: if right, to be kept right; and if wrong, to be set right."
Senator Carl Schurz of Missouri, 1899
_______________________________________________
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: 
 >if if if Pfft! (From: Paul Skinner <email@hidden>)

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