Re: Converting a nested list to return delimited string with TIDs
Re: Converting a nested list to return delimited string with TIDs
- Subject: Re: Converting a nested list to return delimited string with TIDs
- From: Ricardo Montiel <email@hidden>
- Date: Fri, 08 Jun 2001 17:00:01 -0300
on Wed, 6 Jun 2001 22:54:27, Ehsan Saffari at <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.
Hi Ehsan,
Yes, it is possible... once you apply an old trick. Here is the code:
----- Begin Script ----------------------------------------
set EhsanList to {{"aa", "bb", "cc"}, {"dd", "ee", "ff"}}
try
EhsanList as date
on error message
set EhsanList to text 14 thru -16 of message
end try
set EhsanList to my cambiarTexto(EhsanList, "}, {", return & return)
set EhsanList to my cambiarTexto(EhsanList, ", ", return)
EhsanList
on cambiarTexto(xText, xFind, xChange)
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to xFind
set xText to text items of xText
set AppleScript's text item delimiters to xChange
set xText to (xText as text)
set AppleScript's text item delimiters to oldDelims
return xText
end cambiarTexto
----- End Script ------------------------------------------
HTH
--
Saludos (Regards)
Ricardo Montiel
Buenos Aires - Argentina
PS: Please cc me, as I am in digest mode.