Try :
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 everyCharacters to text items of MyDoc
# Build a list containing one occurrence of every characters available in the document set uniqueCharacters to {} repeat with aChar in everyCharacters if aChar is not in uniqueCharacters then copy aChar as text to end of uniqueCharacters end repeat
# Build a list of greek characters available in the document set GreekYes to {} repeat with aGreek in {"α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι", "κ", "λ", "μ", "ν", "ξ", "ό", "о", "π", "ρ", "ς", "Ύ", "φ", "χ", "ψ", "ω"} if aGreek is in uniqueCharacters then copy (aGreek as text) to end of GreekYes end if end repeat
# Build a list of non greek characters available in the document set GreekNo to {} repeat with noGreek in uniqueCharacters if noGreek is not in {space, " ", "(", ")", "-", "+", "=", "|", "{", "}", "°", "[", "]", "^", "/", "·", "$", "€", "‡", "±", "*", "<", ">", "≥", "≤", "≠", ":", ";", ".", ",", "⁄", "‹", "›", "—", "_", "?", "!", "«", "»", "", linefeed, tab, "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "\\"} then copy (noGreek as text) to end of GreekNo end if end repeat
{GreekYes, count GreekYes, linefeed, GreekNo, count GreekNo}
Yvan KOENIG running Sierra 10.12.4 in French (VALLAURIS, France) lundi 17 avril 2017 19:13:26
|