Re: mac to unix path names
Re: mac to unix path names
- Subject: Re: mac to unix path names
- From: Andrew Oliver <email@hidden>
- Date: Fri, 02 May 2003 15:54:44 -0700
>
Sure, unless you happen to have a user folder somewhere other than a
>
folder named "Users" in the start up disk, like I do.
For this reason, the best way of doing this is to use the standard 'path to'
command:
path to users folder
--> alias "Macintosh HD:Users:
This will return whatever is appropriate for your system/OS
version/Country/preferences/domain - I'm guessing, for example, that the
'users' folder on a French system isn't spelled 'Users". We already know not
everyone's disk is called 'Macintosh HD'.
However, how you ascertain the 'shared' element on non-US systems, I have no
idea.
Andrew
:)
On 5/2/03 3:36 PM, "Christopher Nebel" <email@hidden> wrote:
>
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.
_______________________________________________
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.