AppleScript to Unlock Computer stopped working in 10.6
AppleScript to Unlock Computer stopped working in 10.6
- Subject: AppleScript to Unlock Computer stopped working in 10.6
- From: Greg Rumple <email@hidden>
- Date: Tue, 29 Sep 2009 10:58:28 -0700
I recently upgraded all my Mac's from 10.5 to 10.6, and have been
working happily until I discovered a small problem.
As I said, I have several Mac's in my household, including one in my
children's room. This Mac stays locked most of the time, but when
they do earn the right to use it, I typically don't walk into their
room, I instead login from my computer via SSH and used the following
scripts to either Lock or Unlock their computer.
lock
------
tell application "ScreenSaverEngine"
activate
end tell
unlock
--------
tell application "System Events"
if exists process "ScreenSaverEngine" then
tell security preferences
set properties to {require password to wake:false}
end tell
tell application "ScreenSaverEngine" to quit
delay 5
tell security preferences
set properties to {require password to wake:true}
end tell
end if
end tell
The unlock script isn't identical to the way I had in 10.5, as I have
been plugging away at it, but the concept is the same. Disable the
require password option, tell the ScreenSaver to quit, wait 5 seconds,
re-enable the require password option. On 10.6 this doesn't just
fail, it actually puts the computer into a black screen mode, where
you can't actually do anything (it's like a black screen of death, I
haven't found a way out of it at all from the keyboard). I have found
out that if I re-run the lock script I can get it back out of the
black screen mode. I have also verified that my script does indeed
change the require password option, it just seems that quitting the
ScreenSaverEngine isn't alone enough to get the desktop back once the
computer has slept the screen, though I haven't tested this with the
password option disabled to see if it comes back alive with this
script when that is disabled before the screensaver is activated.
I'm curious if anyone has any ideas of how I can get this working
under 10.6, as this was quite a great feature for me as I can even do
this while I'm at my office at work, but now I physically have to
enter my kids bedroom and unlock their computer, which while I'm at
work, isn't exactly an option.
Thanks in advance.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden