on run
set myList to {"a", "b", "c", "A"}
set myResult to FindDupsInList(myList)
end run
-- Alex Zavatone 2011
-- Case insensitive routine to find dup strings in list
on FindDupsInList(myList)
set myNewList to {}
set myDupsList to {}
repeat with myName in myList
-- the next line is REQUIRED or the comparison will fail
-- if you do not, then myName is a reference, not a string
set myName to myName as string
set myCondition to (myName is in myNewList)
if myCondition then
set the end of myDupsList to myName
else
set the end of myNewList to myName
end if
end repeat
return {myDupsList, myNewList}
end FindDupsInList