• 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: Path to library folder w/ network home directory?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Path to library folder w/ network home directory?


  • Subject: Re: Path to library folder w/ network home directory?
  • From: Christopher Nebel <email@hidden>
  • Date: Mon, 21 May 2007 09:45:15 -0700

On May 21, 2007, at 9:28 AM, Shandor Simon wrote:

In one of my scripts, I'm trying to get the path to a folder in a users Library folder. I use the following to do so:

tell application "Finder"
set profilefolders to folder (path to library folder from user domain as string)
end tell


This works fine on my computers, but fails to find the correct path on users who have a network mounted home directory. Is there anything that I can do in that situation?

That script looks essentially correct, though there are two (mostly) pedantic errors:


- "as string" should be "as Unicode text", or it will choke on paths that have sufficiently interesting characters. In fact, you don't need the "as" bit at all; Finder is perfectly happy to work with the alias that "path to" returns by default.

- As a matter of style, it's widely considered best to put the "path to" expression outside the "tell" block, though it shouldn't make a difference in this case.

Aside from that, it looks like it ought to work, and does with my network home. (Don't read too much into that, though; there are lots of different kinds of network home directories.) What's the error, exactly?


--Chris Nebel AppleScript Engineering

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Path to library folder w/ network home directory? (From: Shandor Simon <email@hidden>)

  • Prev by Date: Path to library folder w/ network home directory?
  • Next by Date: version numbers
  • Previous by thread: Path to library folder w/ network home directory?
  • Next by thread: Re: Path to library folder w/ network home directory?
  • Index(es):
    • Date
    • Thread