• 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: Name of current users home folder (OS X)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Name of current users home folder (OS X)


  • Subject: Re: Name of current users home folder (OS X)
  • From: Reinhold Penner <email@hidden>
  • Date: Tue, 28 Jan 2003 08:38:19 -1000

On Tuesday, Jan 28, 2003, at 07:17 Pacific/Honolulu, Mr Tea wrote:

Am I missing something here?

yes, you missed to pay attention to the original request:

Hi all

First I'd like to thank everyone on this list for their continued help. You've helped me many times over.

I've devised a way of finding the current users home folder very crudely, see below:

tell application "Keychain Scripting"
set myUsersKey to name of keychain 1 as string
end tell

Well, that is not correct, since it will NOT give you the user's home folder. The result of the above is the user name.

Obviously this requires that the user has not amended their keychain(s). Is there a better way of achiving this value? I've searched the listing and a few of the obvious Scripting Dictionaries but this was the best I could come up with.

In order to get the equivalent value, I had posted the two commands via the shell:

set userName to do shell script "whoami"

or

set userName to do shell script "id -un"

These two will in fact give you the same value, as the poster had requested.

Surely this would be sufficient:

set homeFldr to path to current user folder

This will give you the alias to the home folder, but it isn't clear from the original post whether that's what the poster really wanted.

And, er, where did the desktop creep in from?

Further careful reading of the original post reveals...

The reason I need this is so that I can create a constant with the location of a file/folder on the desktop of each users 'profile'.

So that's where the desktop came from and that's why I provided that info as well.

HTCIFY, -Reinhold
_______________________________________________
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: 
 >Re: Name of current users home folder (OS X) (From: Mr Tea <email@hidden>)

  • Prev by Date: Can Applescript be used reset errant packages?
  • Next by Date: Re: Name of current users home folder (OS X)
  • Previous by thread: Re: Name of current users home folder (OS X)
  • Next by thread: Re: Name of current users home folder (OS X)
  • Index(es):
    • Date
    • Thread