Antonio Max
Antonio Max

Reputation: 8823

Kill screensaver and unlock a mac using appleScript

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

Upvotes: 13

Views: 8906

Answers (1)

shelhamer
shelhamer

Reputation: 31170

You could try an alternative way to kill the screen saver, such as a shell script with

#!/bin/sh
killall ScreenSaverEngine

And calling it directly, or writing an applescript to call it if you'd like that for some reason to do with the lifehacker article.

Upvotes: 11

Related Questions