Macbook: Change the default Mail Client using Terminal/CLI (Command Line Interface)


If you want to change the default mail client on your Mac then you can use a quick Python script to quickly change the default mail app. Copy/paste the following command into Terminal. Below I am setting Outlook to be the default mail client, but you can replace with whatever application bundle identifier you use.

/usr/bin/python2.7 <<EOF
import LaunchServices;
result = LaunchServices.LSSetDefaultHandlerForURLScheme(
print("Result: %d (%s)" % (
    "Success" if result == 0 else "Error"))

Note: If you’re not sure what the bundle identifier is for your mail app is then simply run:

## Get the identifier for Apple Mail App
osascript -e 'id of app "Mail"'
## Get the identifier for Outlook App
/usr % osascript -e 'id of app "Outlook"'

Leave a Reply

Your email address will not be published. Required fields are marked *