使用 appleScript 终止屏幕保护程序并解锁 Mac
我正在尝试通过蓝牙近距离使用我的 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
它会杀死屏幕保护程序,不显示密码框,但我得到的只是黑屏。所有应用程序仍在运行,但我将鼠标悬停在这个黑屏上。 我在 10.6.7 版本上运行两个监视器。 怎么了?谢谢。
lifehacker 文章 http://lifehacker.com/5816791/use-a-bluetooth-phone-or-device-to-lock-and-unlock-your-mac-when-youre-near< /p>
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试另一种方法来终止屏幕保护程序,例如使用 shell 脚本
并直接调用它,或者编写一个 applescript 来调用它(如果您出于某种原因希望与 lifehacker 文章相关)。
You could try an alternative way to kill the screen saver, such as a shell script with
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.