Automatic login
Automatic login
- Subject: Automatic login
- From: Jess McKenzie <email@hidden>
- Date: Thu, 7 May 2009 22:14:52 +1000
Hi, I'm trying to write a script that sets the automatic login on a mac to the currently-logged-in user. I have written the script below, and it seems to work... but not always. If automatic login is already set to another user on that computer, when you run the script it succeeds in changing it to the current user. However, if automatic login is disabled, the script will run with no errors, but it takes no affect on the autologin preference, leaving it as disabled. Does anyone know if i am doing something wrong in my script?
Thanking in advance...
property shortName : ""
try do shell script "echo $USER" end try
set shortName to result
display dialog "This application perceives that you are currently logged in as: " & shortName buttons {"Deny", "Confirm"} cancel button "Deny" default button "Confirm"
try do shell script "sudo defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser " & shortName with administrator privileges end try
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden