• 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: List appending question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: List appending question


  • Subject: Re: List appending question
  • From: Michelle Steiner <email@hidden>
  • Date: Mon, 11 Aug 2003 17:43:35 -0700

On Monday, August 11, 2003, at 03:54 PM, Chris Backas wrote:

I've got two lists, and I'd like to put the contents of on list into the other - however, not in the appending way.

ListA = {}
ListB = {"Some Stuff","Some Other Stuff"}

I would like to make ListA become {{"Some Stuff", "Some Other Stuff"}} Rather than taking all ListB's value's and appending them to ListA.

Assuming that listA is always an empty list, this will always work:

set ListB to {"Some Stuff", "Some Other Stuff"}
set ListA to {ListB}

If listA is not always an empty list, how to do it depends on what result you want; your example--with one of the lists being empty--doesn't tell us that.

set ListA to {"listA stuff"}
set ListB to {"Some Stuff", "Some Other Stuff"}

set ListA to ListA & {ListB}
--> {"listA stuff", {"Some Stuff", "Some Other Stuff"}}

set ListA to {ListA} & ListB
--> {{"listA stuff"}, "Some Stuff", "Some Other Stuff"}

set ListA to {ListA} & {ListB}
{{"listA stuff"}, {"Some Stuff", "Some Other Stuff"}}

--Michelle

--
We're surrounded. That simplifies the problem.
_______________________________________________
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: 
 >List appending question (From: Chris Backas <email@hidden>)

  • Prev by Date: PDF Services - I'm lost...
  • Next by Date: Re: Send mail using AppleScript
  • Previous by thread: Re: List appending question
  • Next by thread: List appending question
  • Index(es):
    • Date
    • Thread