On Wed, 22 Nov 2006 13:06:55 -0500, Mark Lively <[log in to unmask]> wrote:
> On Nov 22, 2006, at 12:51 PM, Bob R. wrote:
> 
>> Is there a scripting addition freeware that will sort strings of
>> text in alphabetical order, for
>> OSX?
>>
>> Thanks!
>>
> there is the shell command sort
> 
> set foo to {"a", "b", "d", "g", "aa", "bb", "c", "cc", "e", "f"}
> set AppleScript's text item delimiters to return
> set lun to open for access ("/tmp/junk.txt" as POSIX file) with write
> permission
> write (foo as text) to lun
> close lun
> set outtext to do shell script "sort /tmp/junk.txt"
> every text item of outtext

Wouldn't that be:
--
set foo to {"a", "b", "d", "g", "aa", "bb", "c", "cc", "e", "f"}
set AppleScript's text item delimiters to ASCII character 10
try
	close access ("/tmp/junk.txt" as POSIX file)
end try
set lun to open for access ("/tmp/junk.txt" as POSIX file) with write
permission
write (foo as text) to lun
close lun
set outtext to do shell script "sort /tmp/junk.txt"
set AppleScript's text item delimiters to return
every text item of outtext