• 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: Nigel Smith <email@hidden>
  • Date: Fri, 22 Nov 2002 13:38:24 +0000

I wrote:
> Note you'll have to change the first three lines to suit the HD name
> and MAC address of your machine, and your username (hey, I was in a hurry!):

Not any more!

___________________

set {oldTIDs, AppleScript's text item delimiters} to <<break>>
{AppleScript's text item delimiters, ""}
set prefsPath to path to preferences folder as text
set AppleScript's text item delimiters to ":"
set macAddress to every text item of (do shell script <<break>>
"ifconfig en0 | grep ether")
set AppleScript's text item delimiters to ""
set macAddress to characters 8 thru -2 of (macAddress as text) as text
set prefsFile to "" & prefsPath & ":ByHost:com.apple.screensaver." <<break>>
& macAddress & ".plist"
set fileRef to (open for access alias prefsFile with write permission)
set thePrefs to read fileRef
set AppleScript's text item delimiters to return
set thePrefs to "" & paragraphs 1 thru 5 of thePrefs & return & <<break>>
" <integer>1</integer>" & return & paragraphs 7 <<break>>
thru -1 of thePrefs
set eof of fileRef to 0
write thePrefs to fileRef
close access fileRef
ignoring application responses
tell application "ScreenSaverEngine"
run
end tell
end ignoring
delay 5
set fileRef to (open for access alias prefsFile with write permission)
set thePrefs to read fileRef
set thePrefs to "" & paragraphs 1 thru 5 of thePrefs & return & <<break>>
" <integer>0</integer>" & return & paragraphs 7 <<break>>
thru -1 of thePrefs
set eof of fileRef to 0
write thePrefs to fileRef
close access fileRef
set AppleScript's text item delimiters to oldTIDs
___________________

Bring on the improvements!

Nigel
_______________________________________________
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: Charles Arthur <email@hidden>)

  • Prev by Date: Re: lock the screen from the keyboard, win a prize
  • Next by Date: Re: Number of days left in the month
  • Previous by thread: Changing Get File dialog path
  • Next by thread: Re: lock the screen from the keyboard, win a prize
  • Index(es):
    • Date
    • Thread