Re: Name of current users home folder (OS X)
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 05:14:27 -1000
Steve,
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
Obviously this requires that the user has not amended their
keychain(s). Is there a better way of achiving this value?
set userName to do shell script "whoami"
or
set userName to do shell script "id -un"
these two will give you just the user's name. You will need to assemble
the path to the desktop from there. Alternatively, you can get the path
directly (i.e. an alias to it) by
set desktopFolder to (path to desktop)
you can modify the above and make it "as text" or "POSIX path" if you
want to.
HTH, -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.