Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Scripts to disable and enable password for lock screen after sleep or screen saver' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Scripts to disable and enable password for lock screen after sleep or screen saver
Authored by: TheMacAdmin on Dec 07, '12 07:55:09AM

This hint uses UI scripting, which is unreliable and fails if you accidentally hit a key on the keyboard or brush the trackpad/mouse.

The same thing can be achieved with a one-line shell script.

defaults write com.apple.screensaver askForPassword -int 1

to undo it...

defaults write com.apple.screensaver askForPassword -int 0

The script can be rolled into an Automator action/app if you want to have a one-step process to change the setting. You could even create a one-app password toggler by using a "defaults read" command on the same preference key to fill a variable to determine the current state of the "require password" setting and then set it to the opposite value.

Personally I would never do this. Is the perceived inconvenience of entering your password at home worth the risk of forgetting to toggle the password lock, and thereby leaving your data vulnerable, while in public?



[ Reply to This | # ]