When I download mp4 files from Safari, I'd like them to open automatically once they have been downloaded. How can this be done?

Safari Preferences->General->Open "safe" files after downloading is checked.

I want to automatically open file that might not be "safe".


You can add a file extension to the list of "safe" extensions. Once that is done, safari will launch whatever application is associated with that file type.

This is done by creating the file ~/Library/Preferences/com.apple.DownloadAssessment.plist containing the file extension you want opened.

Here is an example, which solves the problem for .torrent files:

<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com-PropertyList-1.0.dtd"> 
<plist version="1.0"> 

More info here.

If the file exists already, edit it and add the <string>torrent</string> line under the <array>tag

  • This solution works great in OS X 10.11 El Capitan 👍 – Ben Morrow Sep 19 '15 at 16:14
  • Doesn't seem to be present anymore? – vy32 Feb 25 '19 at 12:27

One way is to use Hazel. I tried using it and it worked smoothly. However, Hazel isn't free ($25).

The second solution is to use Automator which is part of Mac OS X.

However, using Automator didn't quite work. Some of the mp4 files did open, but for unknown reason some didn't.

Also I'm not sure if Automator has to open the files as soon as they are downloaded, or there is a time frame which it could take to open them. Maybe some one more experiences with Automator could elaborate on this.


This answer will describe how not to get the following message when you open a file downloaded from Safari for the first time.

enter image description here

Well, I'm not sure why you're seeing this, but if your files are going to the ~/Download folder, you will have to tell the Operating System that you want that folder out of the quarantine.

Open your Terminal.app (Spotlight for Terminal) and type:

xattr -d -r com.apple.quarantine ~/Downloads

You might have to do it as super user (in which case, use this instead of the above), so if the above fails try with sudo before the command:

sudo xattr -d -r com.apple.quarantine ~/Downloads

note: You will be asked for your password if you use sudo, this is normal.

What is xattr?

The xattr command can be used to display, modify or remove the extended attributes of one or more files, including directories and symbolic links. Extended attributes are arbitrary metadata stored with a file, but separate from the filesystem attributes (such as modification time or file size).

WARNING: By doing the above, the OS will stop caring about files put in the Downloads folder. If you want to only do this for certain files, you will have to download your "safe" files elsewhere and execute the above command in that folder.

If you want to undo the operation, simply remove the -d

xattr -r com.apple.quarantine ~/Downloads

The -r is to make it recursive (so existing files and folders are also modified).

UPDATE I've realized that new files will be put in quarantine when you download them, so although the above command will go file by file and remove the flag, so you don't have to tell the OS that the file is safe every time, in order to completely disable the mechanism, you have to execute an extra command. please make sure that this is ok with you, since you can't do this for single files, it's an all or nothing.

To Disable the warning dialogs completely for any files in the future, execute this command (Again, I'm not 100% sure if you need sudo, just try without it first.:

defaults write com.apple.LaunchServices LSQuarantine -bool NO

And if you ever want to revert the change:

defaults write com.apple.LaunchServices LSQuarantine -bool YES

I can't recall if you need to logoff/logon again or reboot.

Good luck and be careful with those downloads. :)

A restart IS required after these commands.

Link attached for further reading on the Quarantine.

  • I've updated the answer, have you tried the second command? – Martin Marconcini Feb 16 '13 at 19:34
  • Yes, I understand it. The way it works is that safari will open (certain) safe files. But the definition of safe is "is not in quarantine". So until you "manually" try to open it and get the dialog (and accept the file is safe) this flag will prevent the file from opening. I'm surprised tho' because mp4 should open automatically, maybe there's something else going on here. Try with the 2nd command and tell me how it goes. You have to restart after that. – Martin Marconcini Feb 16 '13 at 19:36
  • did you restart after you executed the commands? It's a system wide service so you have to restart. – Martin Marconcini Feb 16 '13 at 19:42
  • And what is the way I used to ? how are you downloading files? Do you have a sample that I can try? (shall we go to the chat?) :D – Martin Marconcini Feb 16 '13 at 19:53
  • let us continue this discussion in chat – Martin Marconcini Feb 16 '13 at 19:53

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