好的,所以我设置了一个脚本来在我在家时关闭“唤醒时需要密码”功能。它会ping我的手机以查看我是否已连接到网络,如果没有则打开锁定以唤醒。所以:
try
do shell script "ping -c2 X.X.X.X"
set theResult to the result
if theResult contains " 2 packets received," then
tell application "System Events"
tell security preferences
get properties
set properties to {require password to wake:false, require password to unlock:false}
end tell
end tell
end if
on error
tell application "System Events"
tell security preferences
get properties
set properties to {require password to wake:true, require password to unlock:true}
end tell
end tell
end try
end
这工作得很好,但是它要求进行身份验证。我真的不想使用输入文本和返回路线,也不想使用剪贴板路线,因为我不想要脚本中的密码......那么有没有办法避免身份验证?