How can I make my Mac display the login screen (as though I'd selected "Login window" from the fast user switching menu) after the session has been idle for a certain time?

I can make it log out after some amount of inactivity, but I don't want that. I want my programs to continue running.

I can also set the screen saver to require a password, and clicking the "Switch user" button on the password dialog will display the login screen. I'd effectively like to skip that step and go directly to the login screen without having to push the button.

  • What is wrong with the "Require password" on the screensaver ?? Apr 3, 2011 at 10:44
  • I did mention that possibility in the question, but I guess I can expand on why that's not ideal: When I forget to log out properly, the next person who wants to log in to the computer sees the screensaver password dialog instead of the login window. It's not what they're accustomed to seeing, and it gives a stronger indication that I'm still using the computer, which generally isn't true — I just forgot to go to the login window before I left, and I'd rather not let my forgetfulness make waves. Apr 3, 2011 at 16:43

2 Answers 2


One solution could then be this one...

Download this ScriptSaver (ScreenSaver): http://swannman.wordpress.com/projects/scriptsaver/ - which can run AppleScripts.

Then write an AppleScript script with this content:

tell application "Finder"
    do shell script "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -suspend > /dev/null"
end tell

Setup a ScreenSaver in "Desktop & Screen Saver", and configure this with the ScriptSaver, which you then setup with the AppleScript script from above.

After min. 3 minutes the current user session will be switched to the Fast User Switching window.

  • Thank you for sharing ScriptSaver! I was looking for the same thing and this just does it!
    – user6571
    May 18, 2011 at 16:17

Rob, you can use DssW Power Manager to automatically Fast User Switch to the Login Window after user inactivity. This will leave your account logged in and your applications running.

The following link shows you how to create the required event for automatically logging out; in step 4 change the action from Log Out to Fast User Switch to get the behaviour you are after:

How to Automatically Log Out After Inactivity on Mac OS X

DssW Power Manager - User event after inactivity

Power Manager also includes a task to "Secure sleep after inactivity". This task Fast User Switches to the Login Window and then puts the Mac to sleep.

Disclosure: I work for DssW.

  • Looks promising, but a little overkill for my needs right now. Apr 5, 2011 at 15:16
  • @Rob Kennedy, no problem. There is always a free demonstration if you want to prove the concept is possible, before writing and testing your own script. Apr 6, 2011 at 5:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .