Can we no longer script screen savers in Sonoma?

I would like to know if I am the only one seeing this, but since upgrading to Sonoma, I can no longer control screen savers with AppleScript or Terminal.

This used to work:

tell application "System Events"
	start current screen saver
end tell

and now has no effect. Moreover, this used to work:

tell application "System Events"
	set current screen saver to screen saver "Drift"
end tell

and now results in this error:

System Events got an error: Can’t set screen saver “Drift” to screen saver “Drift”.

If I try to set it to a third-party screensaver:

tell application "System Events"
	set current screen saver to screen saver "Hexadrop"
end tell

…it fails silently, without any error. (Hexadrop is one of the savers in the wonderful XScreenSaver.)

Is anyone else able to replicate any of this? I need a sanity check before I submit feedback to Apple.

By the way, I have also tried using defaults write in Terminal:

defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName -string 'Hexadrop' path -string '/System/Library/Screen Savers/Hexadrop.saver' type 0

and then

killall cfprefsd

and that used to work, too, and no longer works for me. The plist changes, but it has no effect whatsoever on which screen saver actually runs.

You’re not the only one. On the Keyboard Maestro forum, there are at least two posts of how Sonoma has broken the screen saver’s scriptability (the one that says Ventura has a more recent comment about Sonoma).

Start screensaver action doesn’t work - Questions & Suggestions - Keyboard Maestro Discourse
Ventura - Macro Does Not Start Screen Saver - Questions & Suggestions - Keyboard Maestro Discourse

Thanks a bunch, cdthomer. I really appreciate it. Good to know I’m not the only one. I guess I’ll submit some Apple feedback, oh joy!

1 Like

I also found this post on Apple Developer Forums:
How to programmatically set screensaver on Sonoma?