Re: File name list order
Re: File name list order
- Subject: Re: File name list order
- From: Christopher Nebel <email@hidden>
- Date: Sun, 19 Dec 2004 21:54:37 -0800
On Dec 10, 2004, at 12:24 PM, Adam K. Wuellner wrote:
On Dec 10, 2004, at 11:00 AM, Michael Conner wrote:
Will this always be the case, or should I sort the list to be on the
safe
side? I was going to use a snippet I found to use a do shell script
sort.
Good question. I would like to pose it more generally:
How does one find out what order the objects in a list returned by
plural object names (or every [element]) are returned in?
I do not see it addressed in the application dictionary, the Language
Guide or AS:TDG.
The Scripting Interface Guidelines
<http://developer.apple.com/technotes/tn2002/tn2106.html> say that
"every thing" means the same thing as "things 1 through -1", except
that you get an empty list instead of an error if there are no things,
which means you get them in index order: thing 1, thing 2, etc.
(Whether or not an application actually does this is, regrettably, an
entirely separate question.)
In the specific case of Finder items, index order is not guaranteed to
correspond to anything in particular. It's really returning things in
the order they appear in the directory structure. For HFS+ disks
(which is what you're probably using), that happens to be the same
thing as alphabetical (for some probably US-centric definition of
"alphabetical".) It's not a good idea to rely on that, however -- it's
subject to change, and other disk formats return items in essentially
random order.
--Chris Nebel
AppleScript Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden