Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to lock my Mac running OS X 10.8 after it has powered up with a script.

I have autologin enabled.

share|improve this question

1 Answer

up vote 0 down vote accepted

Open the AppleScript Editor, and type in this command:

/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend

Save it as a script file. Then, open your System Preferences, go to Account, and add it to the programs that will run upon login.

This command will not log you out; it does the same thing as using the fast user switcher.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.