I was able to do it this way.
Reading:
var moduleDict = CFPreferencesCopyAppValue("moduleDict",
"com.apple.screensaver") as NSDictionary
var saverName = moduleDict["moduleName"] as String!
Writing:
var moduleDict = CFPreferencesCopyAppValue("moduleDict",
"com.apple.screensaver") as NSDictionary
You should read the docs and expect that some domains may require admin rights
or even possibly not be accessible by design.
From CFPreferences docs
Note that modification of some preferences domains (those not belonging to the
“Current User”) requires root privileges (or Admin privileges prio
Sorry, my code is Swift. There is no @"strings".
On Sat, Feb 28, 2015 at 10:14 PM, Graham Cox wrote:
>
> > On 1 Mar 2015, at 12:46 am, Juanjo Conti
> wrote:
> >
> > This settings are not accesibles via NSUserDefaults but they are via CF.
> >
> > I was able to do this by code
> >
> > var moduleD
> On 1 Mar 2015, at 12:46 am, Juanjo Conti wrote:
>
> This settings are not accesibles via NSUserDefaults but they are via CF.
>
> I was able to do this by code
>
> var moduleDict = CFPreferencesCopyAppValue("moduleDict",
> "com.apple.screensaver") as CFDictionary
>
> but when I try to get on
Hi, I'm trying to programmatically change the configured screen saver.
If I do
$ defaults -currentHost read com.apple.screensaver
{
CleanExit = YES;
PrefsVersion = 100;
idleTime = 600;
moduleDict = {
moduleName = ;
path = "/Users/juanjo/Library/Screen Saver