22
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 com.microsoft.Outlook
with whatever application bundle identifier you use.
/usr/bin/python2.7 <<EOF
import LaunchServices;
result = LaunchServices.LSSetDefaultHandlerForURLScheme(
"mailto",
"com.microsoft.Outlook")
print("Result: %d (%s)" % (
result,
"Success" if result == 0 else "Error"))
EOF
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"'
com.apple.mail
## Get the identifier for Outlook App
/usr % osascript -e 'id of app "Outlook"'
com.microsoft.Outlook
Looks like the LaunchServices function “LSSetDefaultHandlerForURLScheme(_:_:)” (https://developer.apple.com/documentation/coreservices/1447760-lssetdefaulthandlerforurlscheme) has been deprecated in macOS 14.2.1.
Any other alternatives?