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

Reply to 'comparing and updating lists'


  • Subject: Reply to 'comparing and updating lists'
  • From: email@hidden
  • Date: Tue, 21 Jan 2003 17:37:35 -0500

I too am new to AppleScript, and while I am sure others may provide more efficient Code - here is something I was able to scribble down.

set list1 to {"1", "2", "3", "8", "9", "12", "68", "24", "5"}
set list2 to {"0", "1", "3", "4", "5", "7", "22", "12", "68", "99"}
set list1ref to a reference to list1

repeat with i from 1 to (length of list2)
set theValue2 to item i of list2
set theResult to false
repeat with j from 1 to (length of list1)
set theValue1 to item j of list1
if theValue2 = theValue1 then
set theResult to true
exit repeat
end if
end repeat
if theResult = false then
copy (theValue2) to the end of list1ref
end if
end repeat

set carriageReturn to ASCII character (10)
set theEndResult to ""
repeat with i from 1 to (length of list1)
set theEndResult to (theEndResult & (item i of list1)) & carriageReturn
end repeat

display dialog theEndResult buttons {"OK"} default button 1
--

SJWL
_______________________________________________
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: UI scripting, windows order
  • Next by Date: Re: Opening a local HTML file in the default browser
  • Previous by thread: Re: Clip2Gif
  • Next by thread: GUI scripting: Set app window attributes - size, position, bounds?
  • Index(es):
    • Date
    • Thread