BlueSense AppleScripts

How to enable Mac OS X session auto login in AppleScript

Re-enable Mac OS X Automatic login with your username.


script EnableAutomaticLogin
try
	set my_password to getPassword(KeychainPasswordName)
	set my_username to getUsername()
	do shell script ("/usr/bin/defaults write /Library/Preferences/com.apple.loginwindow.plist autoLoginUser " & quoted form of my_username) user name my_username password my_password with administrator privileges
on error errString number errorNumber
	log (errString)
end try
end script