I posted the wrong script. The posted one makes no difference between lowercase and uppercase.
Here is the correct version.
script o
property GreekCharacters : {"α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι", "κ", "λ", "μ", "ν", "ξ", "ό", "о", "π", "ρ", "ς", "Ύ", "φ", "χ", "ψ", "ω"}
property noGreekCharacters : {space, " ", "(", ")", "-", "+", "=", "|", "{", "}", "°", "[", "]", "^", "/", "·", "$", "€", "‡", "±", "*", "<", ">", "≥", "≤", "≠", ":", ";", ".", ",", "⁄", "‹", "›", "—", "_", "?", "!", "«", "»", "", linefeed, tab, "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "\\"}
property everyCharacters : {}
property uniqueCharacters : {}
property GreekYes : {}
property GreekNo : {}
property allNoGreek : {}
end script
tell application "TextEdit"
activate
set p2d to path to desktop as text
set theFile to p2d & "TXT.txt"
set theDoc to open file theFile
set MyDoc to text of theDoc
end tell
set o's everyCharacters to text items of MyDoc
considering case
# Build a list containing one occurrence of every characters available in the document
set o's uniqueCharacters to {}
repeat with aChar in o's everyCharacters
set aChar to aChar as text
if aChar is not in o's uniqueCharacters then copy aChar to end of o's uniqueCharacters
end repeat
# Build a list of greek characters available in the document
set o's GreekYes to {}
repeat with aGreek in o's GreekCharacters
set aGreek to aGreek as text
if aGreek is in o's uniqueCharacters then
copy aGreek to end of o's GreekYes
end if
end repeat
set o's allNoGreek to o's noGreekCharacters & o's GreekYes
# Build a list of non greek characters available in the document
set o's GreekNo to {}
repeat with noGreek in o's uniqueCharacters
set noGreek to noGreek as text
if noGreek is not in o's allNoGreek then
copy noGreek to end of o's GreekNo
end if
end repeat
end considering
{o's GreekYes, count o's GreekYes, linefeed, o's GreekNo, count o's GreekNo}