• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: lock the screen from the keyboard, win a prize
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: lock the screen from the keyboard, win a prize (From: Simon Kornblith <email@hidden>)

  • Prev by Date: Re: Tex-Edit X: Web snapping colors
  • Next by Date: FileMaker Pro, get image by reference
  • Previous by thread: Re: lock the screen from the keyboard, win a prize
  • Next by thread: Re: lock the screen from the keyboard, win a prize
  • Index(es):
    • Date
    • Thread