I’m having a brain spasm because this should be straightforward and I keep coming up with kluges.
What makes it all the more frustrating is that I’ve seen the answer before and I can’t find it (in my
experience, thinking you know or have the answer somewhere is a great barrier to creativity).
Problem: a sorted list like {0, 0, 0, 0, 0, 0, 2, 3, 3, 3, 4, 4, 8, 9, 9} has duplicate entries and I want only
the subset of unique values, in this case {0, 2, 3, 4, 8, 9}.
This works for me. I’m certain there is a faster way.
set oldList to {0, 0, 0, 0, 0, 0, 2, 3, 3, 3, 4, 4, 8, 9, 9}
set newList to {}
repeat with myNum from 1 to length of oldList
set myItem to item myNum of oldList
if newList does not contain myItem then set the end of newList to myItem
end repeat
newList