applescript to list number of users

I am looking for an applescript that will list the number of users on a particular machine. Once I get that number, I want to use it as a variable, but I don’t know how to get a number.


Browser: Safari 525.28.3
Operating System: Mac OS X (10.5)


System Events can do this

tell application "System Events" to set numberOfUsers to count user

Bearing in mind that the smallest number is two – you and root.