• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: File name list order
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File name list order


  • Subject: Re: File name list order
  • From: "Adam K. Wuellner" <email@hidden>
  • Date: Tue, 21 Dec 2004 10:25:23 -0600


On Dec 19, 2004, at 11:54 PM, Christopher Nebel wrote:

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.

Thanks for the clarification, Chris.

_______________________________________________
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


References: 
 >File name list order (From: Michael Conner <email@hidden>)
 >Re: File name list order (From: "Adam K. Wuellner" <email@hidden>)
 >Re: File name list order (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: Xmas Etiquette
  • Next by Date: Re: Xmas Etiquette
  • Previous by thread: Re: File name list order
  • Next by thread: Re: File name list order
  • Index(es):
    • Date
    • Thread