Re: Changing the desktop picture
Re: Changing the desktop picture
- Subject: Re: Changing the desktop picture
- From: Killobit <email@hidden>
- Date: Wed, 26 May 2004 15:16:17 -0700
Well, you really dont have to use an apple event, while searching the
list archive (took forever to the dang search page to load...) i found
this bit of code that works wonderfully
[[NSDistributedNotificationCenter defaultCenter]
postNotificationName:@"com.apple.desktop" object:@"BackgroundChanged"];
just go to the plist file, change the ImageFilePath Key's value to a
picture that exists, then run that code in a simple application and it
will update the desktop picture WITHOUT restarting the finder AND
without apple events =)
One other thing does anyone know where some documentation is for making
a contextual menu item for the finder is? Thanks for all help in
advance =)
--Best Regards
Killobit
On May 26, 2004, at 1:18 PM, Shawn Erickson wrote:
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.
_______________________________________________
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.