Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > NSUserDefaults: Setting Default Mail Handler?

NSUserDefaults: Setting Default Mail Handler?
Thread Tools
Mac Enthusiast
Join Date: Dec 2001
Status: Offline
Reply With Quote
Jan 28, 2003, 02:19 AM
 
So, the default Mail Handler for a user appears to be set in com.apple.LaunchServices.plist under the key "U:mailto". Is there a way that I can change this from within my cocoa application? (Yes, I'll be asking the user's permission first). As far as I can tell, NSUserDefaults only adjusts the plist for your own app.
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Jan 28, 2003, 05:05 AM
 
The whole protocol thing seems to be in complete limbo at the moment -

protocol bindings should be set by Internet Config. - although some apps ignore IC (see safari)

Launch Services is Read-Only- I don;t believe that there is an API for changing the LS settings.

Hopefully Apple will sort out this whole mess soon - it's a bit like Creator codes - half there and half ignored. Leading to inconsistent behaviour by different apps.
     
Mac Elite
Join Date: Sep 2000
Location: Tempe, AZ
Status: Offline
Reply With Quote
Jan 28, 2003, 05:07 AM
 
You can call the CoreFoundation CFPreferences routines from within your Cocoa app to do this. Check out /Developer/Documentation/CoreFoundation/ for more info.

You could also use the terminal command 'defaults' - type 'man defaults' for more info.
Geekspiff - generating spiffdiddlee software since before you began paying attention.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jan 28, 2003, 10:37 AM
 
Or you could use [[NSUserDefaults standardUserDefaults] persistentDomainForName:@"com.apple.LaunchServices "] -- however this may break in future releases of OS X, as relying on other apps' prefs is a bad idea
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:06 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2