Re: 'sort' command-alternative?
Re: 'sort' command-alternative?
- Subject: Re: 'sort' command-alternative?
- From: John Delacour <email@hidden>
- Date: Thu, 3 Oct 2002 23:22:55 +0100
- Mac-eudora-version: 5.3 alpha
At 2:31 pm -0400 3/10/02, Rips Ethan J wrote:
b. if there's an alternative, such as a sort command in a shell script that
can be called by Applescript.
Here's a script that returns a sorted list of the the names of
running processes. You can adapt it to any use. You can also sort
by number with a slight addition.
tell app "Finder" to set ls to name of processes
set AppleScript's text item delimiters to {return}
set ls to ls as string -- turn the list into paragraphs
set AppleScript's text item delimiters to {""}
do shell script "perl -e '
$return = qq(\\015) ;
$list = qq(" & ls & ") ;
@array = split /$return/, $list;
for (sort @array) { print qq($_$return) } '"
paragraphs of result
-- JD
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.