How to lock MacBook with a keyboard shortcut? Possible Duplicate:
  Is there a quick way to lock my Mac?  




I am familiar with using Automator, but I do not know what code should be used to accomplish the feature. Can anyone provide the code used to lock my retina MacBook Pro? I want a function similar to the one in Windows when you press Windows+L.
If it helps, on 10.7 Lion, I just use a global two-key shortcut in BetterTouchTool (free/donationware) to start the screen saver and lock my Mac. You'll also need "Require password for sleep and screen saver" set to "immediately" in System Preferences > Security &amp; Privacy > General. The shortcut shown here is ⌘ + L which I prefer to other solutions as its virtually the same key positions for my Windows and Mac machines!



Alternatively, you can also use Ctrl + ⇧ + ⏏/⌽ (eject key, or power key on Macbook Air) to put the display to sleep immediately (this also requires "Require password for sleep and screen saver" set to "immediately" in System Preferences > Security &amp; Privacy > General).