MacOS – OSX/MacOS Search priority for app when opening custom extension

file extensionsmacos

I'm new to the Mac world but have written my first application. I have it packaged as a .app (let's say my_application.app).

My application registers a custom file extension (let's say .xyz). When you open a .xyz file it will open with my_application.app. However, I'm noticing if I have several my_application.app on my machine it's hard to figure out which one will load when you double click on a .xyz file.

For instance, I had my_application.app in my applications folder, but I also had one (an older version) on my desktop. I expected the one in the applications folder to handle opening .xyz files, but instead the one from the desktop opened.

Is there definitive documentation on what the search priority is for finding an app for a custom file extension?

Best Answer

You can choose which application must handle a file type. And change the default application.

You can do it once:

  1. Right mouse click on file
  2. Open with...
  3. It opens the file in the chosen application once.

Menu to open file in...

Or you can decide which application must open all files for a particular file type.

  1. Right mouse click on file
  2. Get Info
  3. Section 'Open with'
  4. Choose the application you want to use for all files from this file type.
  5. Press the 'Change All...' button

Change application for a file type.