Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Unique items in list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unique items in list



Golly I should be able to handle this simple task but I'm failing.

I have a long list that has a lot of dupes. I needs to be narrowed to unique items. I've tried to ways to attack this.

Method A: Works, but I end up with a column of results that I can't coerce back into a list.

repeat with x in finals
set end of finals to x & ", "
end repeat
set finals to (do shell script "echo " & (quoted form of (finals as string) & " | " & "sort -u"))





Method B: Doesn't work at all.

set finals to {1, 5, 5, 5, 6, 66, 999}
set juz to {}

repeat with x in finals
	if x is not in juz then set end of juz to x
end repeat
contents of juz

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.