Re: Changing the desktop picture
Re: Changing the desktop picture
- Subject: Re: Changing the desktop picture
- From: Shawn Erickson <email@hidden>
- Date: Wed, 26 May 2004 13:18:27 -0700
On May 26, 2004, at 5:10 AM, M. Uli Kusterer wrote:
At 4:21 Uhr -0700 26.05.2004, Killobit wrote:
I'm new to the lists and here is my first question (probably the
first of many =) )
Is it possilbe to change the desktop picture programmatically and if
so, how do i do it?
Thanks very much in advance for ANY and ALL help
~/Library/Preferences/com.apple.desktop.plist
And yes, that "garbage data" in there is an AliasRecord, so you'll
want to use the excellent BDAlias class to produce that.
Note that this may not be all, though. You'd need some way to tell the
Finder to reload the image, and right now the only way I know is to
quit and restart the Finder, which you wouldn't want to do too often.
Folks you should never ever try to modify plist programmatically to do
something like this. It is fragile and often will not work without
doing funky things (like having to quit Finder in the above). A plist
is own by the related application and is not a stable "API" into those
applications.
You should use a provided API, command line tool or Apple Events to get
done what you want to get done. Look for those first before even
considering mucking with a plist and if they don't exist file an
enhancement request with Apple about getting a proper method in place,
regardless strongly consider not mucking with the plist.
-Shawn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.