Sorting A List - Need Help
Sorting A List - Need Help
- Subject: Sorting A List - Need Help
- From: Rick Bargerhuff alias cougar <email@hidden>
- Date: Sat, 26 Jul 2003 16:28:05 -0400
Hello all,
I know this has been covered before, in fact when you do a search in
the archives, many posts are found. Problem is, very hard to
find the solution in all the posts. So here we go again...
I am trying to sort a directory the way the Mac OS X Finder does it.
If I use list folder, the result is alphabetically. This is fine but
soon
as I throw a bunch of numbered files into the mix, all heck breaks
loose. For example...
My home folder...
Desktop
Documents
Library
Movies
Music
Pictures
Public
Sites
As you can see it sorts correctly. But if I add untitled folders...
like so...
Desktop
Documents
Library
Movies
Music
Pictures
Public
Sites
untitled folder
untitled folder 10
untitled folder 11
untitled folder 12
untitled folder 13
untitled folder 14
untitled folder 15
untitled folder 16
untitled folder 17
untitled folder 18
untitled folder 19
untitled folder 2
untitled folder 3
untitled folder 4
untitled folder 5
untitled folder 6
untitled folder 7
untitled folder 8
untitled folder 9
zzz
This is sorting via dictionary. The problem is, if I have a list from
the clipboard and it needs to be transfered to the names of these
files, assume these
files are not folders and the list in the clipboard is sorted
correctly, then the transfer will be corrupted. The finder in Mac OS X
sorts these
file names correctly. Meaning 9 comes before 10...
I was looking for an applescript sorting algorithm, I dunno which to
try to port, to solve my problem. Mac OS X Finder sorts it correctly so
I need to somehow mimic what the Finder does. I tried using ls from
the shell but this outputs the same sort order as list folder does.
Reason why I'm doing this is, I'm going to display the directory
contents to the user, I need it be sorted. And it will need to work
99% of the time.
Any suggestions & comments are greatly appreciated and welcomed,
Rick Bargerhuff alias cougar
Programmer / Developer / Computer Specialist
Personal Email: email@hidden
Personal Website :
http://mywebpages.comcast.net/cougar718
_______________________________________________
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.