• 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: Converting a nested list to return delimited string with TIDs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting a nested list to return delimited string with TIDs


  • Subject: Re: Converting a nested list to return delimited string with TIDs
  • From: Chris Page <email@hidden>
  • Date: Thu, 07 Jun 2001 01:00:53 -0700

nigh on 2001.06.06 11:00 PM, Paul Berkowitz at email@hidden wrote:

> On 6/6/01 9:54 PM, "Ehsan Saffari" <email@hidden> wrote:
>
>> I have a nested list:
>>
>> {{"aa","bb","cc"},{"dd","ee","ff"}}
>>
>> and I want to convert it to:
>> "aa"
>> "bb"
>> "cc"
>>
>> "dd"
>> "ee"
>> "ff"
>>
>> is this possible with TIDs? I've already done this with a repeat loop,
>> but can't figure out if TIDS can be applied to a list.
>>
> Applying TIDs in the ordinary way will turn any list, including complex
> nested ones, into a single string. That's what 'text item delimiters' are
> for, to delimit items of a continuous string. E.g.:
>
> set n to {{"aa", "bb", "cc"}, {"dd", "ee", "ff"}}
> set AppleScript's text item delimiters to {return}
> set n to n as string
> set AppleScript's text item delimiters to {""}
> n
>
> -->
> "aa
> bb
> cc
> dd
> ee
> ff"
>
> To get what you want - separate strings on separate lines -- is not, I
> think, possible within AppleScript itself.

How about using a repeat loop over the list, converting each sub-list into a
string, then concatenating them together with whatever separator is desired
between them?

--
Chris Page
Mac OS Lead, Palm Desktop
Palm, Inc.


References: 
 >Re: Converting a nested list to return delimited string with TIDs (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: Location Manager in OS X?
  • Next by Date: Re: Converting a nested list to return delimited string with TIDs
  • Previous by thread: Re: Converting a nested list to return delimited string with TIDs
  • Next by thread: Re: Converting a nested list to return delimited string with TIDs
  • Index(es):
    • Date
    • Thread