Re: Flattening a list
Re: Flattening a list
- Subject: Re: Flattening a list
- From: Andrew Oliver <email@hidden>
- Date: Sat, 15 May 2004 23:05:39 -0700
That's fine as long as you're dealing with string objects in the lists. If
you're dealing with booleans, integers, other lists, named items, or other
object types this process will lose those formats and return all items as
text objects.
Andrew
:)
On 5/15/04 10:16 PM, "Joseph Weaks" <email@hidden> wrote:
>
On May 15, 2004, at 8:21 PM, Michelle Steiner wrote:
>
> Usually, when concatenating items to the end of a list, it's better to
>
> use copy rather than set. However, when trying to flatten a list, you
>
> have to use set.
>
> ...Is there a better way to flatten a list than looping like this?
>
>
"Better" is somewhat subjective, but how 'bout this:
>
>
set variable to "zzz"
>
set a to {{1, "z", 3}, {variable, "b", "c"}, {5, "text", variable}}
>
set AppleScript's text item delimiters to "%"
>
set a to text items of (a as string)
>
set AppleScript's text item delimiters to ""
>
>
>
Cheers,
>
Joe
>
_______________________________________________
>
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.
_______________________________________________
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.