Hi.
If I may come late to the party, here’s an implementation of Shane’s suggestion:
use AppleScript version "2.4" -- OS X 10.10 (Yosemite) or later
use framework "Foundation"
use scripting additions
-- For convenience, the records here are pretty much the same except for uid values.
-- The "duplicate" records in list1 have "DUPLICATE" as their titles to make them
-- easy to spot, but this isn't used in the script.
set list1 to {{arg:"118305", match:"The Origin and Goal of History", subtitle:"", title:"The Origin and Goal of History", uid:"118304"}, {arg:"118305", match:"The Origin and Goal of History", subtitle:"", title:"DUPLICATE", uid:"118305"}, {arg:"118305", match:"The Origin and Goal of History", subtitle:"", title:"The Origin and Goal of History", uid:"118306"}, {arg:"118305", match:"The Origin and Goal of History", subtitle:"", title:"DUPLICATE", uid:"118307"}}
set list2 to {{arg:"118305", match:"The Origin and Goal of History", subtitle:"", title:"The Origin and Goal of History", uid:"118300"}, {arg:"118305", match:"The Origin and Goal of History", subtitle:"", title:"The Origin and Goal of History", uid:"118302"}, {arg:"118305", match:"The Origin and Goal of History", subtitle:"", title:"The Origin and Goal of History", uid:"118305"}, {arg:"118305", match:"The Origin and Goal of History", subtitle:"", title:"The Origin and Goal of History", uid:"118307"}}
-- Get array versions of the lists.
set array1 to current application's class "NSMutableArray"'s arrayWithArray:(list1)
set array2 to current application's class "NSArray"'s arrayWithArray:(list2)
-- Filter array1, keeping dictionaries whose uids don't appear in any of array2's dictionaries.
set uids2 to array2's valueForKey:("uid")
set uidFilter to current application's class "NSPredicate"'s predicateWithFormat_("NOT uid IN %@", uids2)
tell array1 to filterUsingPredicate:(uidFilter)
-- Append array2's dictionaries to what's left.
tell array1 to addObjectsFromArray:(array2)
-- Sort the result by uid, if required.
set sortOnUID to current application's class "NSSortDescriptor"'s sortDescriptorWithKey:("uid") ascending:(true)
tell array1 to sortUsingDescriptors:({sortOnUID})
-- Convert back to list.
set newList to array1 as list