使用appleScript杀死屏幕保护程序并解锁mac

Ant*_*Max 13 iphone macos applescript bluetooth

我正在尝试使用我的iPhone通过蓝牙接近来解锁我的Mac,我正在使用的代码:

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

tell application "ScreenSaverEngine" to quit
Run Code Online (Sandbox Code Playgroud)

它杀死了屏幕保护程序,没有显示密码框,但我得到的只是一个黑屏.所有应用程序仍在运行,但我将鼠标悬停在黑屏上.我在10.6.7版本上运行两个显示器.怎么了?谢谢.

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

she*_*mer 6

您可以尝试其他方法来杀死屏幕保护程序,例如使用

#!/bin/sh
killall ScreenSaverEngine
Run Code Online (Sandbox Code Playgroud)

并直接调用它,或者如果您出于某种原因想与lifehacker文章联系,编写一个applescript来调用它。

  • @shelhamer`killall ScreenSaverEngine`仍然为我生成黑屏。 (2认同)