tell app "File Sharing" (* find out about the first user connected to your machine *) name of connected user 1 end tell
You can close a File Sharing window used to set or alter the privileges for a user or group:
close user "Guest"
This window can be opened from the Users & Groups tab by selecting the username and clicking the Open button (AppleScript cannot open this window, however).
You can delete a user or group:
delete user "temp"
You should not allow important network script commands like delete or make to fall into the wrong hands.
You can create a new user or group with the same privileges as another user or group with duplicate. The following example duplicates a user and gives the new user a name:
tell application "File Sharing" activate set nw_user to duplicate user "iMarc" set name of nw_user to "iMarc2" end tell
This command makes a new user, but the
parameter that is identified in its dictionary does not work.
newuser or group
You can make either a new user or group; you cannot make a new shared item.
Alas, this parameter does not work properly with making new users or groups in AppleScript 1.4, but I include it anyway because it appears in the File Sharing dictionary. The next example shows user- and group-creating code that does work:
tell application "File Sharing" activate set group_name to "graphics" set user_name ...