Reply to 'comparing and updating lists'
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.