I want to change my default media player in macOS.

(In my case, I want to change it to my own AppleScript-created instance of VLC that I exported as ‘VLC-New-Window.app’, which is scripted to always open files in a new VLC instance so that it doesn’t override the existing paused playlist or video file I want to keep in the background.)

It is very tedious to find an example of every file type I use VLC for (whether mkv, avi, mp4, m4v, m4a, m4b, mp3, flac, or m2ts), right-click on it, and manually set the new default program each time.

And honestly I’d like every audio or video file type that VLC can open to be applied here so that I never have to worry about this again.

Is there any method that can help automate this, or do this in batch?


Step 1: Put the list of file types one per line in a text file at ~/types.txt.

Here is an Example for all the VLC-handled video/audio types, in a pretty exhaustive list:


Step 2: Create temporary dummy files of every extension in your user folder.

Open Terminal.app, and using your txt file above do the following command:

while read -r line ; do mkfile 1b file${line} ; done < types.txt

Step 3: Select every dummy file in Finder at once, then press option+command+I. Under 'Open With', select the program you want to change the default to, make sure to click on 'Change All...' button, confirm, and it is done.

|improve this answer|||||
  • 1
    I am sure there is a more elegant single-line command for creating dummy files of multiple file types, so if you know such code please say and I will update the answer to improve it. And for the VLC example, I took the list from here and then added more that I know work with VLC. Please comment if you know more and I will update it accordingly. – ἐλευθερία Apr 12 '18 at 0:19
  • 1
    Where there’s a will, there’s a way. +1 for gumption – bmike Apr 12 '18 at 0:31
  • 1
    If you save the lines in Step 1 into a text file "types.txt" then while read -r line ; do mkfile 1b file${line} ; done < types.txt will create your files for you. – Tony Williams Apr 12 '18 at 4:48

You must log in to answer this question.

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