Re: POSIX file usage
Re: POSIX file usage
- Subject: Re: POSIX file usage
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 30 Aug 2002 00:29:39 -0700
On 8/29/02 11:44 PM, "Adriaan Tijsseling" <email@hidden> wrote:
>
I tried the following
>
>
set unixpath to "/Users/foo/Library/Preferences/somefile.txt"
>
set the macpath to (unixpath as POSIX file)
>
>
But I received NSCannotCreateScriptCommandError (10) for the second
>
statement.
>
I also tried
>
set the macpath to my POSIX file unixpath
>
but that fails with the same error.
set unixPath to "/Users/foo/Library/Preferences/somefile.txt"
set unixFile to POSIX file unixPath -- will compile with colons
set macPath to unixFile as Unicode text
or in two lines:
set unixPath to POSIX file "/Users/foo/Library/Preferences/somefile.txt"
set macPath to unixPath as Unicode text
You should probably also be aware of:
set macPath to (path to preferences from user domain as string) &
"somefile.txt"
which is better, because it will work no matter what the language of the
user's machine, where "Users", "Library" and "Preferences" are all called
something different.
--
Paul Berkowitz
_______________________________________________
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.