I'm using AppleScript to lock the Mac from an external device (trigger) and unlock it from this same device.
Locking works great but when unlock my Mac keyboard and pads becomes unresponsive. Weird thing is when I move mousse after locking and get the password login if I enter the password the unlock makes keyboard responsive and only then.
Is it some kind of security settings I'm not aware of? How could I solve it?
Here is the script I'm using:
Lock:
tell application "System Events"
tell security preferences
set require password to wake to true
end tell
end tell
activate application "ScreenSaverEngine"
Unlock:
tell application "System Events"
tell security preferences
set require password to wake to false
end tell
end tell
tell application "ScreenSaverEngine" to quit
Please help I'm desperate. Also if you have another method you know to lock/unlock my Mac using code I would love to try it out!
Thanks!
UPDATE: To be clear when removing the password setting code (require password) the issue doesn't appear. Meaning removing those 3 lines:
tell security preferences
set require password to wake to true
end tell
Doesn't have this issue, this is why I think it could be some security thing I'm not aware of.
UPDATE (26 Dec 2013): I didn't find any solution and bounty finished so what I'm doing is inserting my password using ActionScript (maybe this could help others having same issue). If you do have another solution I would love to know.