• 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: Delete an Item from a list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Delete an Item from a list (From: Steven Valenti <email@hidden>)

  • Prev by Date: Re: Any way in applescript to use an image as a folder icon?
  • Next by Date: Applescript question
  • Previous by thread: Re: Delete an Item from a list
  • Next by thread: moving a Script object to a load script file
  • Index(es):
    • Date
    • Thread