Re: Delete an Item from a list
Re: Delete an Item from a list
- Subject: Re: Delete an Item from a list
- From: Christopher Stone <email@hidden>
- Date: Fri, 4 Jun 2004 09:28:50 -0500
At 14:27 -0400 06/03/2004, Steven Valenti wrought:
I want to manipulate a list by taking some items out. I have read that
you can't delete items from a list. Does anyone have another way of
doing this besides the way I come up with here? Thanks
______________________________________________________________________
Hey Steven,
Paul has covered the vanilla.
You can also use the Satimage osax for this task. It's clean and quite fast.
----------------------------------------------------------------------
set l to {"One", "Two", "Three", "Four", "Five", "Six", "Seven",
"Eight", "Nine", "Ten"}
suppress item 2 from l
--> {"One", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten"}
----------------------------------------------------------------------
http://www.satimage.fr/software/en/downloads_osaxen.html
For multiple items:
----------------------------------------------------------------------
set l to {"One", "Two", "Three", "Four", "Five", "Six", "Seven",
"Eight", "Nine", "Ten"}
set supList to {"One", "Four", "Seven", "Ten"}
set killList to {}
tell l
repeat with i from 1 to length
if item i is in supList then
set end of killList to i
end if
end repeat
end tell
set killList to reverse of killList
set l to suppress item killList from l
--> "0.0023374" seconds on my machine
Chris
_______________________________________________
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.