Terminal Question

New Contributor

Anybody can chime to see how I can change "com.apple.mail" to point to com.microsoft.outlook using the defaults write command or any other ideas would help. We currently block all users from using the Mail.app so we cannot change it from there.

Gracias jamfnation peeps

{ LSHandlerPreferredVersions = { LSHandlerRoleAll = "-"; }; LSHandlerRoleAll = "com.apple.mail"; LSHandlerURLScheme = mailto; }

We need to change it to this:

<dict> <key>LSHandlerPreferredVersions</key> <dict> <key>LSHandlerRoleAll</key> <string>-</string> </dict> <key>LSHandlerRoleAll</key> <string>com.microsoft.outlook</string> <key>LSHandlerURLScheme</key> <string>mailto</string> </dict


Contributor II

I'm not good at deciphering some of this stuff, but are you trying to change the default email app to Outlook? If so, Rich Trouton has a great article about this:


I may be completing mis-reading this request, however.

New Contributor II

I may be mis-reading this request as well but you could just make a copy of the plist file, edit the changes you need, package it and push it out to your users as opposed to using defaults write cmd

Legendary Contributor III

I don't recommend just packaging up a plist and deploying it, since you are effectively overwriting a client's preferences when you do this. Its a fine enough process when you're first setting up a Mac or setting up a new account, but doing this after the fact will only clobber a client's unique preferences, and offer no explanation as to why their settings were reverted to something else. That plist contains a lot of settings for Launch Services and application helpers, so I don't think its a good idea.

You could look at using duti as many others have, as this utility has the ability to set these preferences pretty easily with a simple command line call to the binary. The only issue is that the duti binary needs to be deployed to clients to use it, since its not native to the OS.
While its possible to script a change to the plist, the way the plist is structured makes it tough, almost impossible really, to do with defaults. You would probably need to look at using PlistBuddy instead.