• 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: Owner/User Name in OSX
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Owner/User Name in OSX


  • Subject: Re: Owner/User Name in OSX
  • From: garbanzito <email@hidden>
  • Date: Wed, 24 Apr 2002 10:41:33 -0600

at 2002 04 24, 15:00 +0100, they whom i call Simon Topliss wrote:
How do I get the current owner/user name in OSX? I need the long version,
not just the path to the user's home.

try this:

set short_name to do shell script "whoami"
set long_name to do shell script "niutil -readprop . /users/" & short_name & " realname"
display dialog short_name & " (" & long_name & ")"

the two names will be the same unless the long name has more
than 8 characters.

--
steve harley email@hidden
_______________________________________________
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.

  • Follow-Ups:
    • Re: Owner/User Name in OSX
      • From: John W Baxter <email@hidden>
    • Re: Owner/User Name in OSX
      • From: Simon Topliss <email@hidden>
References: 
 >Owner/User Name in OSX (From: Simon Topliss <email@hidden>)

  • Prev by Date: Large Quark Doc Comparisons
  • Next by Date: Re: Record-access command examples for XML parsing?
  • Previous by thread: Owner/User Name in OSX
  • Next by thread: Re: Owner/User Name in OSX
  • Index(es):
    • Date
    • Thread