In Mac OS X there are several ways to lock your screen automatically. However, what if you only want to lock your screen when you want?
Here’s the answer, and it involves Automator.
Create a new Workflow in Automator, and then add the “Run Shell Script” action to your Workflow. Then add the following command into it.
/System/Library/CoreServices/”Menu Extras”/User.menu/Contents/Resources/CGSession -suspend
As so:
You can then save your Workflow as an Application.

Ensuring that you have Fast User Switching enabled, when this application is run it will drop your desktop onto the login window while keeping your processes running.
