How to programmatically set screensaver on Sonoma?

The BOINC installer asks the user if they would like to set BOINC as their screensaver. If they answer yes, it sets it for them. Both of the following methods work under Ventura and earlier, but no longer work under MacOS 14.0 Sonoma.

Applescript: tell application "System Events" to set current screen saver to screen saver "BOINCSaver"

Shell script: defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName "BOINCSaver" path "/Library/Screen Savers/BOINCSaver.saver" type 0

The defaults method also worked under Ventura and earlier by passing the corresponding CFMutableDictionaryRef to CFPreferencesSetValue.

What is the way to set a screensaver for all spaces and displays under Sonoma?

Replies

Shell script: …

The defaults method …

The screen saver implementation changed a lot in macOS 14. As a side effect of that, it no longer consults these (undocumented) user default settings.

AppleScript: …

I’d expect that to continue working. Did you file a bug about this? What was the bug number?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Add a Comment

workaround i've been using

  1. create a "Start Screen Saver" shortcut in the mac shortcuts app
  2. create an apple script with the following
tell application "Shortcuts Events" to run the shortcut named "Start Screen Saver"

Please take a look at https://forum.iscreensaver.com/t/understanding-the-macos-sonoma-screensaver-plist/718