Re: User Name in OS X +
Re: User Name in OS X +
- Subject: Re: User Name in OS X +
- From: Philip Aker <email@hidden>
- Date: Mon, 21 Oct 2002 23:53:02 -0700
On Monday, Oct 21, 2002, at 22:55 US/Pacific, Duncan Cowan wrote:
I'm having trouble getting the full "User Name" of the current user
with AS.
I can't seem to get it from the Account pref pane, from the Apple
System
Profiler (without complicated text filtering)
or from file ownerships . . .
(In fact I can't seem to make the Pref Panes return anything . . .)
If I get "owner" of "info for" an item, I get the short user name not
the
full account name . . .
"user name" appears to be a valid AS key word but I don't know exactly
where
or what to call it from.
Am I way off track?
The reason I need the full name is so that the script will be user
independent.
I've thought of creating an "install" script that with generate a pref
file
with the users name - but it would be nice to avoid this.
Advice received with appreciation.
This works for me:
on FullUserName()
set res to (do shell script ("finger " & (system attribute "USER")))
set full_name to (words 4 thru -1 of paragraph 1 of res)
set {tid, AppleScript's text item delimiters} to {AppleScript's text
item delimiters, space}
set {full_name, AppleScript's text item delimiters} to {full_name as
string, tid}
full_name
end FullUserName
FullUserName()
HTH,
Philip Aker
http://www.aker.ca
_______________________________________________
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.