# Mac OS X - auto login followed by immediate activation of screen saver

How can I activate the screen saver immediately after Mac OS X (10.6) logs me in automatically? I want the computer to reboot and log me in after a power failure, but I don't want it to be accessible to someone who happens to be standing nearby.

-
I don't understand the point. If you just set it to require a login on reboot, isn't that equivalent behaviour? –  ghoppe Sep 3 '10 at 15:10
@ghoppe logging in and locking the computer means you won't have to wait for the desktop environment to load. –  Stephen Jennings Sep 3 '10 at 15:48
Thanks. An Automator action also works the same way. The loss in security is slight. This will keep people out unless they they take advantage of physical access to reset passwords, etc. –  user48423 Sep 3 '10 at 17:31
Another (bit more expensive) solution: buy an SSD. –  pattern86 Jun 17 '11 at 2:31

## 2 Answers

Add a login script. It could either be done via the Shell:

open -a ScreenSaverEngine


or via Applescript:

tell application "ScreenSaverEngine" to launch


Applescript is probably the easiest way if you're not familiar with Shell scripting. Open Script Editor (Spotlight it), paste in the above script, and click File->Save As. Select Application as the file format. Save it somewhere, ~/Applications, ~/Library/Scripts, etc. Open up Accounts.prefPane, click on the login items tab for your account, hit the add button, then go find where you saved your script to.

If you're really that concerned about security though, you should disable autologin.

-

The system actually has built-in support for doing this:

defaults write /Library/Preferences/com.apple.loginwindow autoLoginUserScreenLocked -bool true

-
Can you link to documentation on the developer site for this? Where did you find this? –  pattern86 Jun 17 '11 at 2:32
Which versions of OS X support this plist key that you know of. I'm going to look more into this. –  pattern86 Jun 17 '11 at 3:59
Works on 10.6. Does NOT appear to work on 10.5. If you find out anything else, let me know. –  Gannet Jun 18 '11 at 10:51