Re: mac to unix path names
Re: mac to unix path names
- Subject: Re: mac to unix path names
- From: Christopher Nebel <email@hidden>
- Date: Fri, 2 May 2003 15:36:51 -0700
On Friday, May 2, 2003, at 09:49 AM, Rob Morton wrote:
on 5/2/03 9:57 AM, Carl Albrecht-Buehler at email@hidden wrote:
on 05/02/2003 8:17 AM, Ben Waldie wrote:
set theMacOSPath to "Macintosh HD:Users:Shared:"
set theUnixPath to POSIX path of theMacOSPath
Thanks a whole lot, Ben; that's just about the trick I was looking
for! I
have one concern though: This example yields the result of "/Macintosh
HD/Users/Shared/".
Change your file a bit.
set theMacOSPath to ":Users:Shared:"
set theUnixPath to POSIX path of theMacOSPath
By making theMacOSPath start with a : it doesn't matter what you call
your startup disk.
Sure, unless you happen to have a user folder somewhere other than a
folder named "Users" in the startup disk, like I do.
"POSIX path of" will only yield a truly correct result if the Mac path
actually exists. If it doesn't, "POSIX path" will try to fake it by
translating all the colons to slashes and slapping an extra slash on
the front. In the case of non-existent folders, this works, but if you
give it a disk name that doesn't exist, you get something completely
useless.
Incidentally, the fact that "POSIX path" is only documented to work on
file and alias objects. The fact that it works on strings is a bug,
but it's not one that we'll ever fix in AppleScript 1.x, since
obviously people are relying on it.
--Chris Nebel
Apple Development Tools
_______________________________________________
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.