Re: Can I Speed Up This Folder Browsing Script?
Re: Can I Speed Up This Folder Browsing Script?
- Subject: Re: Can I Speed Up This Folder Browsing Script?
- From: Christopher Nebel <email@hidden>
- Date: Wed, 10 Nov 2004 01:03:51 -0800
On Nov 9, 2004, at 5:28 PM, Mr Tea wrote:
This from Christopher Nebel - dated 9/11/04 10ยท46 pm:
Relative addressing is your friend:
Well that certainly works a treat. Can you tell me, Chris, what
criteria the Finder uses to determine which folders come 'before' and
'after' the current folder?
It's the one with the next lower (or higher) index, which makes it
semantically equivalent to your original, but makes the Finder do the
heavy lifting. (That is, it *should* be equivalent -- technically, an
application can do whatever it wants, but that's how "before" and
"after" are supposed to be defined.)
I've tried three methods (yours, mine, and a suggestion from Chris
Stone that involved adding 1 to the index of the current folder to
identify the 'next' folder), and all of these move through folders in
alphabetical order, regardless of how the folders are arranged in view
options.
That's correct. This is less than ideal, but allowed according to the
Scripting Interface Guidelines. (See Object Specifiers > Key Forms >
Index.)
In connection with the above, can someone explain to me why the Finder
insists on ordering non-alphanumeric characters - eg, bullets (opt+8)
and diamonds (opt+shift+v) - before numbers and letters, when
virtually everywhere else in OS X (and always in earlier systems) they
appear AFTER 0-9 and a-z.
Blame the Unicode Consortium. File names are Unicode, Unicode defines
collation order, and one of the collation rules (at least for US
English) is that all punctuation comes before all the letters. Any
application that does Unicode comparison correctly will produce the
same results. If you see something doing the "right" thing, it is in
fact probably wrong -- it won't behave correctly with various European
locales. I suppose that if you were feeling really clever, you could
define a new locale whose sorting was the same as MacRoman, but I don't
know how to do that.
--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