Re: Sorting? [sorted]
Re: Sorting? [sorted]
- Subject: Re: Sorting? [sorted]
- From: bill fancher <email@hidden>
- Date: Fri, 13 Sep 2002 21:18:05 -0700
Or you could do it with Python (installed by default on 10.2):
set s to "page1_box1
page1_box10
page1_box11
page1_box12
page1_box13
page1_box14
page1_box15
page1_box16
page1_box17
page1_box18
page1_box19
page1_box2
page1_box20
page1_box21
page1_box22
"
set text item delimiters to ASCII character 10
do shell script paragraphs of ("python -c '
temp = \"\"\"" & s & "\"\"\"
temp = [name[0:9] + \"%.2d\" % int(name[9:]) for name in temp.split()]
temp.sort()
for name in temp:
print name[0:9] + \"%d\" % int(name[9:])
'") as string
BTW, the construct
set text item delimiters to ASCII character 10
paragraphs of whatever as string
is nice for multi-line shell scripts too:
set text item delimiters to ASCII character 10
do shell script paragraphs of ("
echo Man Page for grep:
man grep | col -b
") as string
--
bill
_______________________________________________
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.