Kill screensaver and unlock a mac using appleScript

Viewed 8142

I'm trying to unlock my mac using my iPhone via bluetooth proximity, the code I'm using:

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

tell application "ScreenSaverEngine" to quit

It kills the screensaver, doesn't show the password box but all I get is a black screen. All applications still running but I'm hovering the mouse on this black screen. I'm running two monitors on a 10.6.7 build. What's wrong? Thanks.

lifehacker article http://lifehacker.com/5816791/use-a-bluetooth-phone-or-device-to-lock-and-unlock-your-mac-when-youre-near

1 Answers
Related