Set default mail app? (take 2)

bentoms
Release Candidate Programs Tester

Hi All,

On my 10.8 image, i'd like to change the default mail client from Mail to Outlook.. so far without much luck (original post was here: https://jamfnation.jamfsoftware.com/discussion.html?id=4085).

I've tried the below MCX, but this doesn't seem to work on 10.8:

Display Name: Default Email Application Application Domain: com.apple.internet Key Name: mcx_defaultEmailReader Key Type: string Key Value: /Applications/Microsoft Office 2011/Microsoft Outlook.app

If I try the below, then the launch services plist gets overwritten at login. (due to the JSS's inability to other MCX settings that work Once for AD accounts https://jamfnation.jamfsoftware.com/discussion.html?id=4499
).

Display Name: Default applications Description: Sets preferred applications. Apply Setting To: User Level At Every Login Domain: ~/Library/Preferences/com.apple.LaunchServices Key: LSHandlers Value: <array> <dict> <key>LSHandlerRoleAll</key> <string>com.microsoft.outlook</string> <key>LSHandlerURLScheme</key> <string>mailto</string> </dict> </array>

Duti, (https://sourceforge.net/projects/duti/), seems to only work for the logged in user.. & not for templates :( (if only the JSS would run scripts once per user per computer: (https://jamfnation.jamfsoftware.com/featureRequest.html?id=45)

Am i missing something?

1 ACCEPTED SOLUTION

tkimpton
Valued Contributor II

Hi mate

I had a similar problem a few months ago. A work around is to

  1. create a local script to set the defaults using duti.

  2. Then put a launch agent (Created with Lingon) to run the script in the user template.

  3. Add a line at the bottom of the script to delete the users launch agent

Happy days :)

View solution in original post

6 REPLIES 6

tkimpton
Valued Contributor II

Hi mate

I had a similar problem a few months ago. A work around is to

  1. create a local script to set the defaults using duti.

  2. Then put a launch agent (Created with Lingon) to run the script in the user template.

  3. Add a line at the bottom of the script to delete the users launch agent

Happy days :)

rcorbin
Contributor II

There must be an easier way to do this ? Configuration profile ?

bentoms
Release Candidate Programs Tester

FWIW i used duti as @tkimpton suggested & run the following @ login via a launch agent:

#!/bin/sh

duti -s com.microsoft.outlook mailto
echo "Default Mail client set to Microsoft Outlook..."

duti -s com.apple.Safari public.html
echo "Default Web client set to Safari..."

iweiss
New Contributor III

Our environment is mostly 10.9. We tried MCX, Config Profiles, Defaults write, Bash scripts, editing the LaunchServices db and Duti, but they were either too complex or not reliable. It was hard for me to believe that there was no easy way to set this. Finally I ran across the AppleScript listed below on the Google MacEnterprise forum. It is simple and appears to work well in testing. At first this script only worked when I ran it from the AppleScript Editor. I had tried pasting it into the JSS, but it appeared to do nothing when run. Then I tried saving as text(.applescript), uploading via Casper Admin and now it seems to work great. Not sure if it needs the quit signal at the end. Hope this helps others.

tell application "Microsoft Outlook"
    set system default everything application to yes
end tell
tell application "Microsoft Outlook" to quit
end

ktappe
New Contributor III

(As posted in the other thread) I can't get this script to work in Sierra. Open to thoughts on how to currently achieve the default switch to Outlook.

NobleK
New Contributor II

Same issue here. Tried various scripts and recommendations, but this does not seem to work with Sierra. Has anyone had any further success?