Unlock Mac from Terminal or Automator

authenticationautomatorterminalunlock

In my attempt to start iPlayer and BBC News every morning, I have scheduled Automator to open a page. It does work, however my Mac stays locked, therefore I need to get out of my bed and enter the password and then set iPlayer to run fullscreen.

The second can be probably overcome by setting to click at x,y coordinates. However, I wasn't able to find anything on how to authenticate the user. Perhaps I should send sequence of key presses?

I am running 10.8.

Thanks.

Best Answer

It is not possible anymore in OSX 10.8 the only option I can think of is to disable your password from the lock screen manually in:

System Prefs > Security > General > Require password

But you have to have fileVault disabled as well maybe below then does work for 10.8?

Edit: I've tested the code below in OSX 10.8 and below doesn't work for 10.8 :(

So make sure this runs before the rest ( and maybe even add a location check to disable authentication when you are at home or connected to your wifi network )

In applescript:

tell application "System Events"
    set require password to wake of security preferences to false
end tell

or

do shell script "defaults write com.apple.screensaver -int 0"

To enable the settings again use true or 1.