我想以编程方式解锁 mac。目前我正在为这个提议使用 Apple 脚本。它工作正常,但问题是这是一个耗时的过程。执行脚本大约需要 4-5 秒。这是我使用 NSAppleScript 执行的脚本。请建议我如何让它快速工作。或任何其他最快的方式。谢谢
tell me to activate\n
tell application \"System Events\" to keystroke \"PASSWORD\"\n
tell application \"System Events\" to keystroke return\n
tell application \"System Events\" to keystroke return"
最佳答案
tell application "System Events"
tell security preferences
set require password to wake to false
end tell
end tell
tell application "System Events"
stop current screen saver
end tell
tell application "System Events"
tell security preferences
set require password to wake to true
end tell
end tell
关于objective-c - 以编程方式解锁 MAC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29443520/