Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8815595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:25:08+00:00 2026-06-14T04:25:08+00:00

I have 2 lists, I need to add the elements contained in the first

  • 0

I have 2 lists, I need to add the elements contained in the first list to the second list.
If the second list contain some of the element of the first list, those shoudn’t be added to the second list (to avoid repetitions).

At the moment I’m using:

set ListB to ListB & ListA

But obviously these doesn’t take into account duplicates.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:25:10+00:00Added an answer on June 14, 2026 at 4:25 am

    When the list contains only strings and doesn’t contain linefeed as in adayzdone example code you can use a faster method when both lists contains thousands of items.

    --NOTE: Only works with lists containing strings and not containing linefeeds. 
    set listA to {"A1", "A2", "A3"}
    set listB to {"B1", "B2", "A3"}
    
    set AppleScript's text item delimiters to linefeed
    set newList to every paragraph of (do shell script "sort -fu <<< " & quoted form of ((listA as string) & linefeed & listB as string))
    set AppleScript's text item delimiters to ""
    
    return newList
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two lists: ask[] timeStamp[] I need to add the information in these
so i have a list where i need to add new values constantly but
I have three lists, I need to move Animal object from list animalSource to
I have a list of two-item lists and need to search for things in
I have a list of lists, and I need to find the longest one
I have a container (List) of some elements of type T and want to
I have a Generic::List(String^)^ myList and some std::string & myValue values, and I need
I have 2 lists of different objects, that I need to join on 2
I need small help. I have 2 lists( say A and B) which have
I have this dropdown. I need clone for my other dropdown lists: <select name=general>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.