Re: Programatically Uncheck "Change Picture" In Desktop Settings?
Re: Programatically Uncheck "Change Picture" In Desktop Settings?
- Subject: Re: Programatically Uncheck "Change Picture" In Desktop Settings?
- From: "I. Savant" <email@hidden>
- Date: Fri, 13 Feb 2009 22:36:03 -0500
On Feb 13, 2009, at 5:34 PM, Ken Thomases wrote:
Contrary to I. Savant, I don't think going through NSUserDefaults or
CFPreferences will work. It still won't inform the necessary
processes of the change in an active manner.
You're likely right - the process in question would have to be
listening for changes to its preferences, which it's probably not.
However, my point was to illustrate that merely changing a plist is
the absolute least likely to trigger the desired change in the active
application / system process using that plist as a persistent store
for the state of its preferences. Let alone the 'tradition' of
unceremoniously killing a process to force it to load that changed
plist ...
In any case, even if you're sure you fully understand what
preference keypaths are used for a given function (ie legacy
preferences that have been migrated or simply deprecated), you still
need to worry about your direct-file-manipulations clobbering (or
being clobbered by) a flush from the preferences system in the given
domain. Wanna' take that chance with your user's system that you know
all the pros and cons? :-)
It's for this reason that the 'traditional' way to add a shortcut
to the Dock is considered dirty and wrong (modifying its plist and
forcibly killing the process to force it to reload its preferences
when it respawns), which is only necessary because of a lack of public
API.
Of course in this case, it appears AppleScript will do the job (I
wouldn't know - I've never attempted what the OP is attempting).
That's a considerably better option. :-)
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden