• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: POSIX file usage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >POSIX file usage (From: Adriaan Tijsseling <email@hidden>)

  • Prev by Date: Re: POSIX file usage
  • Next by Date: Re: Opening System Preference Panes
  • Previous by thread: Re: POSIX file usage
  • Next by thread: Re: Mai.app - Get sender ...
  • Index(es):
    • Date
    • Thread