• 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
comparing and updating lists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

comparing and updating lists


  • Subject: comparing and updating lists
  • From: Bis <email@hidden>
  • Date: Tue, 21 Jan 2003 16:33:15 +0000

thanks JJ!

bis

A quick sample:

set list1 to {"1", "2", "3"}
set list2 to {"1", "2", "3", "4"}

if list1's length is not equal to list2's length then -- only if needed
repeat with i in list2
if i is not in contents of list1 then set list1's end to i's
contents
end repeat
end if

list1 --> {"1", "2", "3", "4"}

JJ


> hiya!
>
> a newbie query about lists:
>
> If I have two lists
>
> list1 {"1","2","3"}
> list2 {"1", "2", "3", "4"}
>
> what i want to do is:
> 1) loop through both lists
> 2) get a list of those items which are in list2 but not in list1
> 3) copy the missing items from list2 to list1
>
> What I eventually want to do is to have a script which checks a
> folder (list2) periodically for newly added files (like "4") and
> copies any newly added files to another folder (list1).
>
> any help or advice or example scripts would be greatly appreciated.
>
> thanx loads for your patience!
>
> bis
> --


--
_______________________________________________
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.

  • Prev by Date: Re: comparing and updating lists
  • Next by Date: Re: GUI Scripting
  • Previous by thread: Re: comparing and updating lists
  • Next by thread: Re: Re: comparing and updating lists
  • Index(es):
    • Date
    • Thread