I have created a workflow that receives texts from any application and sorts it alphabetically.
Like this:
https://i.imgur.com/iMd5Stx.png
The selected text is on the form as one word per line, like
um
uma
você
vocês
vos
à
às
é
éramos
The problem is that the result does not sort words with accented chars. All words with accented chars are put at the end.
Any way to sort case insensitive and considering accented chars from applescript, without having to change ZFH/BASH environment language?
macos_boy:
I have created a workflow that receives texts from any application and sorts it alphabetically.
Like this:
https://i.imgur.com/iMd5Stx.png
The selected text is on the form as one word per line, like
um
uma
você
vocês
vos
à
às
é
éramos
The problem is that the result does not sort words with accented chars. All words with accented chars are put at the end.
Any way to sort case insensitive and considering accented chars from applescript, without having to change ZFH/BASH environment language?
You can use AppleScriptObjC:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use scripting additions
set theInput to "um
uma
você
vocês
vos
à
às
é
éramos"
set theArray to current application's NSArray's arrayWithArray:(paragraphs of theInput)
return (theArray's sortedArrayUsingSelector:"localizedCaseInsensitiveCompare:") as list