0

I'm new to Mac from the Linux world, and I am looking for a command or file providing a list to default user applications associated with certain filetypes. For example, on Linux:

$ cat /usr/share/applications/defaults.list

provides the application names and priority hierarchies on Linux. I've tried something similar using defaults on the Mac, but I can't seem to find what I'm looking for.

$ defaults read | grep pdf
  name = "1309.0238.pdf";
  name = "1309.0238.pdf";

Does the Mac operating system have a simple, command-line function or accessible file to find the default applications?

1

Not easily. You can use the well-hidden lsregister command to dump the contents of the Launch Services database, which is what controls which file types open with which applications:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump

but its output isn't well documented -- there's some info here, but it's over 10 years old so it's probably at least partially obsolete. A bit of Googling turns up some AppleScripts for further parsing, that you might be able to adopt:

  • You can also use: /S*/L*/F*/C*/F*/L*/S*/lsregister -dump – user3439894 Mar 15 '17 at 20:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .