【AppleScript】配列のソート

hw2-suito.blogspot.com

--aListをソート
on sortList(aList)
set command to "perl -e"
set perlScript to quoted form of "print join ' ', (sort @ARGV)"
set the_array to aList
set ARGV to join(the_array, " ")
set the_result to do shell script command & " " & perlScript & " " & ARGV
split(the_result, " ")
end sortList
on join(aArray, deliChar)
set defaultDelimita to AppleScript's text item delimiters
try
set AppleScript's text item delimiters to deliChar
set temp to text items of aArray as Unicode text
set AppleScript's text item delimiters to defaultDelimita
on error errMsg number errNum
set AppleScript's text item delimiters to defaultDelimita
return ""
end try
return temp
end join
on split(aText, deliChar)
set defaultDelimita to AppleScript's text item delimiters
set AppleScript's text item delimiters to deliChar
set array to text items of aText as list
set AppleScript's text item delimiters to defaultDelimita
return array
end split

返信を残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA