targendaz2 / Mac Set Default Apps
Programming Languages
Projects that are alternatives of or similar to Mac Set Default Apps
Mac Set Default Apps (MSDA)
MSDA provides an easy way to silently change the default applications used by macOS. There are no pop-ups or prompts and, even better, it works for Google Chrome!
Requirements
- macOS 10.14.0 or newer
- Python 2 (which, for now, comes pre-installed on macOS)
Deploying
As a Local Installation
- Download the latest packaged release of MSDA here
- Install the package on as many target Macs as needed, either manually or through a system such as Munki or Jamf
As a Jamf Script
Note: I assume these instructions will also work for MDM services other than Jamf, I just only have familiarity with Jamf
- Copy the contents of payload/msda.py into a new Jamf script
- Set the
JAMF
variable toTrue
in the User-Editable Settings section
Usage
Note: If using MSDA as a Jamf script, you would add these arguments in the Parameter 4 text field when assigning the script to a policy, excluding the initial msda
Base Usage
msda command -h --version
- command can only be the following, for now
- set: Set an application as a default
- -h, --help: Show MSDA's help message
- --version: Print the current version of MSDA
Set Command Usage
Note: The set
command must be run with administrative privileges
msda set [-h] [-feu] [-fut] [-e EXTENSION ROLE] [-p PROTOCOL] [-u UTI ROLE] app_id
- app_id: The ID of the application to set as a default app
- -h, --help: Show help for the
set
command - -feu: Apply the specified changes to all existing users
- -fut: Apply the specified changes to the
English.lproj
user template in addition to the currently logged on user (if there is one) - -e, --extension:
- EXTENSION: Specifiy a file extension that the specified app should handle
- ROLE: The scenario under which the specified app should handle this UTI
- -p, --protocol: Specify a protocol that the specified app should handle
- -u, --uti:
- UTI: Specifiy a UTI that the specified app should handle
- ROLE: The scenario under which the specified app should handle this UTI
Examples
Set Google Chrome as the default web browser for the current user and the user template
msda set com.google.chrome -p http -p https -u public.url all -u public.html viewer -u public.xhtml all -fut
Set Microsoft Outlook as the default email client for all existing users and the user template
msda set com.microsoft.outlook -p mailto -feu -fut
Set Adobe Acrobat as the default PDF reader for the current user only
msda set com.adobe.acrobat.pro -u com.adobe.pdf all
Set Google Chrome as the default web browser and email client for the current user and the user template
msda set com.google.chrome -p http -p https -p mailto -u public.url all -u public.html viewer -u public.xhtml all -fut
FAQ
How can I find an application's ID?
Run
osascript -e 'id of app "Name of App"'
in a Terminal window, replacing the text between the double quotes with the name of the application in question.
How can I figure out what protocols or UTIs to set?
I've tried to include the most common examples above. Otherwise, a complete list of protocols can be found here, and UTIs here.
Are there commands other than set
?
At the moment, no. Please create an issue on this app's GitHub page if there are commands you'd find useful.
Why aren't there any examples of setting a default app for a file extension?
I don't believe that this is used to set default apps on Macs anymore. Typically, you'd use UTIs and protocols. This feature was included to prevent MSDA from malfunctioning when being used on a Mac where a default app was assigned to a file extension. If I'm wrong about this not being used anymore, please create an issue on this app's GitHub page and I'll add examples as necesary.
Where can I go for help with this app?
If you need help with this app specifically, please feel free to create an issue on this app's GitHub page. I'll try to either respond, or implement changes to the app as soon as possible.
What about help with other Mac-related things?
Jamf Nation, the MacSysAdmin subreddit, and the MacAdmins Slack channel are all great resources for help managing Macs in an enterprise environment.