I'm trying to control my screensaver via defaults write under Leopard. I can disable the screen saver via this method, but then, it won't re-enable. Here's what I do to disable it:
Later I want to turn on the screensaver. I do so via the following command:
However, despite the correct setting of idleTime, the screensaver never turns on again, and I have to go to System Preferences and manually change the idle time to Never and then to 3 minutes in order to cause the screensaver to start working again.
I want to control the screensaver programmatically and not via the System Preferences panel, because I'm doing so within an AppleScript. What else do I need to do, in addition to setting idleTime with defaults write, in order to turn the screensaver on again after it was previously turned off?
Thanks in advance.
defaults write ByHost/com.apple.screensaver.xxxxxxxx write idleTime 0
(where xxxxxxxx is my mac address). This successfully disables the screensaver. I can tell that the command worked, because the screensaver doesn't turn on any more, and when I do the appropriate defaults read, I get the following results:
Code:
% defaults read ByHost/com.apple.screensaver.xxxxxxxx
{
askForPassword = 0;
idleTime = 0;
lastPictureDirectoryChosen = "/Applications/matrix2";
moduleName = "3D Matrix Code";
modulePath = "~/Library/Screen Savers/3D Matrix Code.saver";
tokenRemovalAction = 0;
}
Later I want to turn on the screensaver. I do so via the following command:
defaults write ByHost/com.apple.screensaver.xxxxxxxx write idleTime 180
I know that the command worked, because I get the following results with an appropriate defaults read:
Code:
% defaults read ByHost/com.apple.screensaver.xxxxxxxx
{
askForPassword = 0;
idleTime = 180;
lastPictureDirectoryChosen = "/Applications/matrix2";
moduleName = "3D Matrix Code";
modulePath = "~/Library/Screen Savers/3D Matrix Code.saver";
tokenRemovalAction = 0;
}
However, despite the correct setting of idleTime, the screensaver never turns on again, and I have to go to System Preferences and manually change the idle time to Never and then to 3 minutes in order to cause the screensaver to start working again.
I want to control the screensaver programmatically and not via the System Preferences panel, because I'm doing so within an AppleScript. What else do I need to do, in addition to setting idleTime with defaults write, in order to turn the screensaver on again after it was previously turned off?
Thanks in advance.
.