Re: lock the screen from the keyboard, win a prize
Re: lock the screen from the keyboard, win a prize
- Subject: Re: lock the screen from the keyboard, win a prize
- From: Philip Aker <email@hidden>
- Date: Sat, 23 Nov 2002 07:39:10 -0800
On Friday, Nov 22, 2002, at 17:50 US/Pacific, Simon Kornblith wrote:
[...]
set posixFile to do shell script "ls
~/Library/Preferences/ByHost/com.apple.screensaver.*.plist"
[...]
Nice try Simon but 'ls' returns more than one file on my setup. The
script below is a 'set' rather than a 'save/set/restore' but can be
adapted easily by using a 'defaults read ...' call.
--Begin
on ss()
ignoring application responses
tell application "ScreenSaverEngine"
run
end tell
end ignoring
end ss
on EngageScreenSaver(theBoolean)
try
set val to theBoolean as string
set ssdir to (POSIX path of (path to preferences as string) &
"ByHost/")
set macs to (words 2 thru -1 of (do shell script "ifconfig en0 | grep
ether")) as string
set sspath to ssdir & "com.apple.screensaver." & macs
set res to (do shell script "defaults write " & sspath & "
askForPassword " & val)
my ss()
on error errs number errn
return errs
end try
end EngageScreenSaver
EngageScreenSaver(1)
--End
Cheers,
Philip Aker
http://www.aker.ca
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.