Sunday, July 22, 2018

#1 2003-07-05 11:16:42 pm

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

Remove Duplicates from List

Oddly enough, this script will remove duplicates from a list.

OS version: Any

Applescript:

--the_list can contain any type of item
set the_list to {1, 2, 3, 3, "3", "3", "3", 4, 5, 4, 5, 4, 1, 1, 2}
set return_list to {}
repeat with an_item in the_list
   if return_list does not contain an_item then set end of return_list to (contents of an_item)
end repeat
return return_list


One mans trash is another mans treasure

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)