1304 Views 4 Replies Latest reply: Apr 5, 2008 10:31 AM by Király
This Terminal command switches to the login window:
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
This one sleeps your Mac:
osascript -e 'tell application "System Events" to sleep'
I used Automator to write my script. I used the "Run Shell Script" action, and entered the above two commands. I also added a sleep 3 command between the two, which pauses for three seconds. Then I saved the workflow as an application.
I then used a program called Spark (search www.versiontracker.com for it) that allows one to program keystrokes to launch applications. I used it to set control-F13 to launch the Automator app.
I don't understand your reasons for doing this but the following will work to bring you to the login window when you come out of a screensaver. You can compare it with Király 's solution when she posts it.
1. Download and install [Scriptsaver|http://www.macupdate.com/info.php/id/9599].
2. Save the following apple script somewhere:
do shell script "/System/Library/CoreServices/Menu\ \Extras/User.menu/Contents/Resources/CGSession -suspend"
remove the space between backslashes between Menu and Extras in the above.
3. Configure the scriptsaver to run your favorite screen saver and to execute the above apple script on screen saver deactivation.
4. (Optional) Uncheck the option is security system prefs to ask for password when coming out of screen saver.