Keyboard shortcut/script to toggle “screensaver unlock password protection” on OS X

When I’m at work I usually enable the password protection to unlock the screen after the screensaver was on or the screen was turned off. But at home I wanted it off and all this switching back and forth was getting on my nerves.
So I wanted a shortcut to do it.
And there is none.
But there is AppleScript!
Yay!

I opened the AppleScript Editor, wrote this code…

tell application "System Events"
  set require password to wake of security preferences to not (require password to wake of security preferences)
end tell

…and saved it as a .scpt Script File to /Library/Scripts.

Now all I needed was some way to assign a keyboard short to run this script. I used Quicksilver, but there are plenty of others, e.g. Butler.

Happy switching!

Leave a Comment