Re: Toggle Screensaver
Re: Toggle Screensaver
- Subject: Re: Toggle Screensaver
- From: "Adam Bell" <email@hidden>
- Date: Sat, 18 Feb 2006 21:03:58 -0400
And, to confuse matters, Kai, I did make those changes without success. It was only when I got annoyed and moved all but one of them out of the parent folder that everything fell into place. As I had said much earier, some of them were old left-overs from earlier versions of OS X, I'm sure by the dates on them. Not your concern, but something to look for if others complain that this doesn't work for them.
In the meantime, it's in my bag of tricks with your name on it, with thanks.
On 2/18/06, kai <email@hidden
> wrote:
On 19 Feb 2006, at 00:23, Adam Bell wrote:
> Your script began working perfectly when I simply trashed all but
> the most current version of the com.apple.screensaver .plist files.
That's why I asked (18 Feb 2006, at 16:32) whether you had only one
plist file containing an idleTime key, Adam. If there *was* more than
one, it could have explained why the script was failing on your
machine. The "relatively simple fix" that I alluded to involved
deleting the 'exit repeat' statement (which ensures that *all* files
with an idleTime key are amended):
--------
set f to (path to preferences folder as Unicode text) & "ByHost"
tell application "Finder" to set l to (folder f's files whose name
starts with ¬
"com.apple.screensaver
" and name does not contain "slideshow")
repeat with i in l
set p to (i as Unicode text)'s POSIX path
tell application "System Events" to tell property list item ¬
"idleTime" of property list file p to if exists then
if value is 0 then
set value to 180
else
set value to 0
end if
end if
end repeat
tell application "ScreenSaverEngine"
launch
quit
end tell
--------
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden