Re: Simple if .. else .. then statment
Re: Simple if .. else .. then statment
- Subject: Re: Simple if .. else .. then statment
- From: Bill White <email@hidden>
- Date: Sat, 29 May 2004 12:22:01 -0400
On 5/29/04 11:11 AM, Rick Davis <email@hidden> wrote:
>
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?
Rick,
Here's a simple example:
set theList to {1, 2, 3, "x", "y", 4}
repeat with i from 1 to count theList
set thisItem to item i of theList
if class of thisItem is integer then
-- do something with the item, such as...
beep 3
else
-- do something else...
display dialog thisItem
end if
end repeat
Is that what you're after?
Bill
_______________________________________________
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.