Re: Sorting A List - Need Help
Re: Sorting A List - Need Help
- Subject: Re: Sorting A List - Need Help
- From: John Delacour <email@hidden>
- Date: Sun, 27 Jul 2003 00:24:45 +0100
- Mac-eudora-version: 6.0a28
At 4:28 pm -0400 26/7/03, Rick Bargerhuff alias cougar wrote:
I was looking for an applescript sorting algorithm
Try this. I've written it so that it ought to work in any script editor.
set ls to paragraphs of "untitled folder 15
untitled folder 16
untitled folder 19
untitled folder 201
untitled folder 3"
set my text item delimiters to ASCII character 10
set s to ls as Unicode text
set my text item delimiters to ""
do shell script "perl -e '
for (split qq~\\012~, qq~" & s & "~) {
s~\\d+~sprintf(\"d\",$&)~e;
push @ls2, $_}
for ( sort @ls2) {
s~ (0+)([1-9]+)~ $2~ ;
print qq~$_$/~};'"
_______________________________________________
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.