does anyone know if there is an easier way to do get the difference between two arrays
heres what I have
set Array1 to {"a", "b", "c", "d"}
set Array2 to {"a", "b", "c"}
set Difference to {}
repeat with anitem in Array1
if anitem is not in Array2 then
set Difference to Difference & return & anitem
end if
end repeat
Don’t know that this is “easier” or not, but a slightly different approach.
set Array1 to {"a", "b", "c", "d", 1}
set Array2 to {"a", "b", "c"}
set Difference to {}
if (count of Array1) is greater than or equal to (count Array2) then
repeat with anItem in Array1
if anItem is not in Array2 then set Difference's end to contents of anItem
end repeat
else
repeat with anItem in Array2
if anItem is not in Array1 then set Difference's end to contents of anItem
end repeat
end if
return Difference
yes that would be but for some reason I can’t seem to get that to work I don’t have Satimage Scripting Additions on my lt but I do on the G5 and don’t even see anything in the dict for difference. maybe I need the addtion upgraded?