MACSCRPT Archives

November 2006

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Lively <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 22 Nov 2006 13:06:55 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (19 lines)
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

ATOM RSS1 RSS2