Re: User Name in OS X +
Re: User Name in OS X +
- Subject: Re: User Name in OS X +
- From: Duncan Cowan <email@hidden>
- Date: Tue, 22 Oct 2002 19:22:47 +1000
The gulf appears to be widening - and I hadn't even reached the edge .
. .
Thanks for all responses. They worked perfectly
(How? Don't even think of asking me)
I might have to have a look at this shell scripting thing . . .
Cheers
D
On Tuesday, October 22, 2002, at 06:56 PM, bill fancher wrote:
On Monday, October 21, 2002, at 11:53 PM, Philip Aker wrote:
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
The NetInfo tool, niutil, is handy here:
on fullUserName()
do shell script "niutil -readprop . /users/`whoami` realname"
end fullUserName
-bill
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.