Re: Removing items from lists
Re: Removing items from lists
- Subject: Re: Removing items from lists
- From: Ben Waldie <email@hidden>
- Date: Sun, 6 Oct 2002 11:11:20 -0400
On Sunday, October 6, 2002, at 10:16 AM, Goldfish wrote:
>
What would be the correct syntax for removing an item from a list?
>
>
e.g. set x to every item of {"the","quick","brown","fox"} except
>
"quick"
>
>
Any ideas?
Try this...
set itemToRemove to "quick"
set theList to {"the", "quick", "brown", "fox"}
set theNewList to {}
repeat with a from 1 to (count theList)
set cItem to item a of theList
if cItem !A itemToRemove then set end of theNewList to cItem
end repeat
return theNewList
- Ben
Benjamin S. Waldie
AppleScript Guru
http://www.applescriptguru.com
http://www.wtmedia.com
_______________________________________________
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.