On Mar 26, 2025, at 08:08, Gabriel Zachmann via Cocoa-dev <cocoa-dev@lists.apple.com> wrote: > > I have a screensaver that uses a number of settings the user can change > through the Options in System Settings. > > It uses several dictionaries, one per display type (built-in, external > monitor, ...). > > In an app, I would use this command line to change one of the settings (while > the app is not running): > > defaults write de.zach.ArtSaverApp "Built-in Retina Display_0" -dict-add > FontName -string "Museo Slab" > > Does anybody know, if/how I could achieve the same thing with my screen saver?
If you read 'man defaults', you'll see that you should be able to manipulate a defaults file by its path. However, when I try it on my legacy screensaver's plists, it fails, saying the file doesn't exist. Even when using sudo, it can't find it. If I list the known domains, my screensaver is not listed. This is all likely because legacyscreensaver hides everything under its own Container. ~/Library/Containers/com.apple.ScreenSaver.Engine.legacyScreenSaver/Data/Library/Preferences/ByHost/com.your.domain.screenID-hex-number.plist -- Steve Mills Drummer, Mac geek Why do you need to write to your screensavers prefs outside of the System Prefs window? Debugging? If so, just add temporary lines of code that manipulate the prefs when your screensaver loads: #if DEBUG ScreenSaverDefaults* prefs = [ScreenSaverDefaults defaultsForModuleWithName:MyModuleName]; [prefs setBlah:x forKey:kKey]; #endif -- Steve Mills Drummer, Mac geek _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com