111 comments to Lock your Mac’s screen like in Windows, Snow Leopard edition

  • Adam

    Awesome! Used your method exactly… worked like a charm.

  • Lauren

    thank you! this is just what i was trying to do!!!!!

  • Grendel

    Nice work around!
    Too bad this work around was needed though.
    Most modern OS’s seem to have screen lock features built in.

  • Fede

    Muchas gracias por la info!

  • brandon

    nice thanks! loving the cube animation.

  • Aditya

    Love the animation and the shortcut, but the shortcut doesn’t work globally. I need to have Automator running and in focus for the shortcut to work.

    Is that expected, or am I doing something wrong?

    • Hi Aditya,

      You’re definitely doing something wrong. Automator DOES NOT have to be running for this to work. I’d suggest looking over the instructions again carefully and maybe starting from scratch. Make sure you’re choosing Service in step 1.

      You can delete your old service by looking for it in ~/Library/Services (that’s the Library folder in your Home folder). If you don’t see a file with the name of your service in there, then you didn’t select Service in step 1 when you created it.

  • Doug

    Awesome tip. Quick question though…

    Any way that this can be a “global” (for all user accounts) setting?

    I had to go into each user account (4 of them) and create the new service and keyboard shortcut.

    I tried putting the created service in /Users/Shared/Library/Services directory (the Services folder had to be created).

    It’s no big deal if it can’t be done for all users, just would make it a lot easier if I were make a change in the future.

    Thanks in advance if you come up with something.

    • Doug,

      If you create the folder /Library/Services (that’s the global Library folder in the top level of your hard drive) and move the files into there from ~/Library/Services (that’s the Library folder in your user home folder), they will show up for all users of the computer. Only catch is the keyboard shortcuts still have to be set on a user by user basis, but this at least cuts out at least half your work.

  • Aniket

    I have a Mac OS X Leopard (10.5.8), and I do not see the option ‘Service’ when I open up the Automator application. Please guide me on how I can create a service through automator. Thanks.

    • Hi Aniket, as the title and body of the article indicates, this hint is for Mac OS X 10.6 Snow Leopard only and will not work on Mac OS X 10.5 Leopard. Please see this previous hint for a solution that works in Leopard. It uses a small application as opposed to a service. Unfortunately Mac OS X Leopard doesn’t have the built-in ability to create custom services from Automator.

  • Aniket

    Thanks Madgunde! It’s awesome :)

    I also used the keychain access trick, and it works fine too. Is there any disadvantage using that versus your script?

  • Darlene Baker

    What does it mean if my new service doesn’t display in the service listing?

  • Johnny Cocknocker

    That works beautifully! The problem with the is that the screensaver starts but all of the running applications suspend instead of running in the background. The same is true with the Keychain option.

    I like this much more better.

  • andrew

    Thank you heaps :)

  • Nina

    This is awesome. Thanks.

  • Aditya

    Thank You! I was able to recreate the service so that it works as a hotkey on all apps. I must have done something wrong the first time.

    But, I noticed one thing… Whenever I lock the computer, it turns airport off, and the computer loses internet connection. Is there a way not to do that?

    Aditya

  • todd

    Kewl! The most important thing for me is that you have removed my fear of AppleScript and Automator. I have beginner level CLI skills, and have always been scared to death of moving forward and deeper into the power of Unix and scripting…thank you! So much to learn. What an adventure!

  • Greg

    Thanks much. This is very helpful!

  • Joe

    Anyone else notice that the screen lock has some race conditions? Tomorrow I’ll post on YouTube a video where the screen saver’s lock ‘activated’, but I could still interact with the system (open up applications, terminal windows, etc, and do as I pleased) without ever entering username/password even though it was asking for it. Click on my website to see the video, or click here….

    • Wow. Thanks for posting that. Do you know what versions of Mac OS X are affected? Just curious if that was a vulnerability that was patched already.

      In any case, it’s a good reason to use my hint in this article to activate the fast user switching login screen instead of the screensaver as some commenters seem to prefer. Personally, I never liked the idea of using the screensaver for this very reason.

  • Joe

    It affects all current versions of OSX, to include Leopard and Snow Leopard (server and workstation versions). No, it has no been patched yet.

  • Sy

    I followed everything you said Up. I even created a Services folder in the Root directory so that all users can have access to this feature. It is displayed in the services list and when I click from there the Login Window appears. But when I type the shortcut I have set Command + L it just makes a sound and does not Lock my Mac. I even changed the shortcut to Command Option L and still does not. I have Mac OSX 10.6.4. Is there something I’m missing here?

    • Remember that keyboard shortcuts are user profile specific so you’ll likely have to create them manually for each user. Did you try the keyboard shortcut I suggested in the hint? Ctrl+Opt+Cmd+L? I find most shortcuts using just Cmd or Option (or both) don’t work, probably because they’re reserved by the OS.

  • Mocha

    Thanks for the ifo, its amazing how we don’t even use 50% of the apps that comes with Mac OX. I def have to take UNIX and Linux

  • Robert Davis

    Another great article – I love this website :)

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>