• 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: getting users
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getting users


  • Subject: Re: getting users
  • From: "John C. Welch" <email@hidden>
  • Date: Mon, 12 Jan 2004 21:15:49 -0600

On 1/12/04 5:36 PM, "Martha Espinosa" <email@hidden> wrote:

> Is there a way to use applescript to find out who has an account on a
> machine...
>
> Thanks In Advance..

Under panther or Jaguar?

Under panther, it's simple:

tell application "System Events"
set theUsers to every user
end tell

Now the big problem with that is you're going to get users that don't log
in, like www, and others. If you want non-root users, then you can use:

tell application "System Events"
set theUsers to every user whose home directory contains "/Users/"
end tell


If you have your home directories somewhere else, then it gets trickier. One
way is to exclude users whose home directory contains /var, /private, or
/Library

john

--
"Full plate and packing steel!"
Baldur's Gate
_______________________________________________
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.

  • Prev by Date: Speakable Items
  • Next by Date: Re: Images and FMP
  • Previous by thread: Re: getting users
  • Next by thread: Re: getting users
  • Index(es):
    • Date
    • Thread