• 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: Simple if .. else .. then statment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple if .. else .. then statment


  • Subject: Re: Simple if .. else .. then statment
  • From: Michelle Steiner <email@hidden>
  • Date: Sat, 29 May 2004 09:01:07 -0700

On May 29, 2004, at 8:11 AM, Rick Davis wrote:

I think I need to step away from the computer. What should be a simple thing is stumping me. How do I tell my script to look at a list of items and perform a task if a condition is met and skip to the next item in the list if the condition is not met?

You don't need "else" in this situation because there is no else to do.

set aList to {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
repeat with anItem in aList
if anItem mod 2 is 0 then
display dialog (anItem as text) & " is even"
say (anItem as text) & " is even."
beep
end if
end repeat

--
We're not human beings having a spiritual experience.
We're spiritual beings having a human experience.
_______________________________________________
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: 
 >Simple if .. else .. then statment (From: Rick Davis <email@hidden>)

  • Prev by Date: Simple if .. else .. then statment
  • Next by Date: Re: Simple if .. else .. then statment
  • Previous by thread: Simple if .. else .. then statment
  • Next by thread: Re: Simple if .. else .. then statment
  • Index(es):
    • Date
    • Thread