Re: How to find current user?
Re: How to find current user?
- Subject: Re: How to find current user?
- From: Kent Behrends <email@hidden>
- Date: Thu, 28 Oct 2004 18:01:19 -0700
On Oct 28, 2004, at 17:14, Roger Howard wrote:
On Oct 28, 2004, at 12:00 PM, Bernardo Hoehl wrote:
Is this what you want?
set CurrentUser to do shell script "whoami"
set ThePath to "/Users/" & CurrentUser & "/Library/Preferences/"
I would caution against this approach, especially for a lab scenario,
as not all $HOME directories are located there, especially if it's a
remote home directory (but even certain local accounts - root's $HOME
is elsewhere). It will work on a stock OSX, but it won't handle many
other scenarios.
Then maybe:
set ThePath to (do shell script "printenv HOME") &
"/Library/Preferences/"
---
Kent Behrends
BEHR Consulting International
http://www.bci.com
GPG Public key:
http://www.BEHRconsulting.com/gpg/kent-behrends-gpg-pub-key.txt
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden