• 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: Sifting a list sans loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sifting a list sans loop


  • Subject: Re: Sifting a list sans loop
  • From: Arthur J Knapp <email@hidden>
  • Date: Mon, 28 Jan 2002 10:15:04 -0500

> Date: Sat, 26 Jan 2002 20:43:13 -0600
> From: ehsan saffari <email@hidden>
> Subject: Sifting a list sans loop

> I have many lists of 2000-5000 items.
> In each list each item is either a list or a string.
> I need to discard the lists and keep the strings for further processing.

-- Here you go:
--
set newList to every string of bigList



This works for almost any AppleScript type-class. One word
of caution: for a list of 5000 items, you might run into
AppleScript's upper limit for returning a list, approx 4050
some items or so:

if ( count of strings in bigList = 5000 ) then

set newList to every string of bigList
--
--> error "Memory overflow..."



{ Arthur J. Knapp, of <http://www.STELLARViSIONs.com>
<mailto:email@hidden>
try
<http://www.seanet.com/~jonpugh/>
on error number -128
end try
}


  • Follow-Ups:
    • Re: Sifting a list sans loop
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Main Event (?)
  • Next by Date: Re: Problems with speed & issues with coercion in OS 9.2.2 (App
  • Previous by thread: Re: Sifting a list sans loop
  • Next by thread: Re: Sifting a list sans loop
  • Index(es):
    • Date
    • Thread