Leaving this answer here, but it may not work for you, since you most likely need privileged access to call CFPreferencesSetValue() . It has been several years since I made one of them.
If you do not need this feature to work with the sandbox, then the desired tool is the lower-level preference interface, CFPreferences . In particular, you can use CFPreferencesSetValue() and CFPreferencesCopyValue() together with kCFPreferencesAnyUser .
It is possible that this will work for isolated applications, but I have not tried. According to the "Settings and Settings Guide" in the "Managing Settings Using Core Foundation" section:
Writing applications outside the application domain is not possible for applications installed in the sandbox.
This hints that this is legal as it is in the application domain. But it is entirely possible that application sandboxes will write this application domain preference in the sandbox for each user, so this will not work. You must try.
source share