Decide which mail app to use for mailto: links
Decide which mail app to use for mailto: links
- Subject: Decide which mail app to use for mailto: links
- From: Paul Brown <email@hidden>
- Date: Wed, 18 May 2016 13:04:02 -0400
I wrote a Mac app that is a little directory lookup tool. You search for a name (or partial name), it pulls user info from a database and shows the results in a table view. One of the columns is for Email Address. It is a button that shows the address on hover, and when clicked, it opens the mailto: link to compose an email to the person, like so:
NSWorkspace.sharedWorkspace().openURL(NSURL(string:String(format:"mailto:%@",sender.alternateTitle))!)
Is it possible to have the user select their preferred mail application that will respond to this? In my experience on iOS, there are URL schemes for many apps that let a variety of apps pass data to other apps. Is this a thing on OS X? The use case here is that I have my personal email account configured in Mail.app, and my work email configured in Outlook 2016. It would be great to have a pref pane in my app to let the user choose which mail app is used.
PS - yes, I should probably not force-unwrap that NSURL. i’m getting there… :-)
Thanks,
Paul
_______________________________________________
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