Re: path to as string
Re: path to as string
- Subject: Re: path to as string
- From: has <email@hidden>
- Date: Fri, 1 Jul 2005 00:26:45 +0100
Matt Neuburg wrote:
>That's the remark that started this whole thread! So, you see, we've come
>full circle. The thing that's in the dictionary doesn't work and the thing
>that works isn't in the dictionary. That's my point.
File a bug report and move on. I accumulated a list of something like 50 bugs in AppleScript, Standard Additions, Finder, TextEdit and iTunes. You'll go mad trying to detail them all, so provide the usual warnings up front, then just show users what works and is good practice; and the less said about the rest, the better. For example, HFS paths are kinda legacy and rarely necessary, so you could focus on using POSIX paths and sidestep this issue completely; e.g.:
POSIX path of (path to ...)
Admittedly, AppleScript also manages to botch these in various places. I think the 'pathTxt as POSIX path' can fail on some non-English paths, though creating a 'POSIX file pathTxt' specifier seems to work OK so use that instead. Also, 'POSIX path of someAlias' screws up when you've multiple drives with the same name; see this thread for more info: <http://bbs.applescript.net/viewtopic.php?pid=42187>
>Or, hey, here's an even wilder idea: if I
>say path..as string and it doesn't need any encoding info (i.e. it's all
>ASCII), return a string - but if it does need encoding info, return
>(double-gasp) Unicode text!
This particular mess exists because someone decided to define a brand new AppleScript type to handle unicode data instead of putting it behind the same 'one-size-fits-all' facade that is its 'string' type. The genie has been out of the bottle for far too many years already, and fixing that one particular problem won't do anything to address the dozens of others.
Realistically, I think the only way Apple will properly solve all of AppleScript 1.x's myriad problems is with a clean start: eliminating osaxen (which are a lousy language extension mechanism and well overdue for a knock on the head) and replacing the existing AppleScript 1.x implementation with a ground-up rewrite, most likely based on Cocoa which already does all this 'Language 101' stuff properly. Perhaps if/when the perpetually vaporous AppleScript 2.0 finally condenses one of these decades...? :p
Alternatively, you can always bail for another language like Python, which has its faults but is still a hundred times more robust and rational than AppleScript. It's a lot less painful than a nervous breakdown, anyway. ;)
has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
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