3

Is there anyway to prevent that whatever app change the default app for some kind of files?

As an example, my default app for movies (mp4, mkv, avi, ...) is VLC, and I don't want this to be changed for whatever reasons.

  • and the "Always Open With" does not work for you? – Ruskes Jan 20 '15 at 18:25
  • That option works, the point is to disable that option for several extensions. – jherran Jan 20 '15 at 18:48
7
+25

I'm using OS X 10.10.1.

The file that stores the "Open With" data seems to be ~/Library/Preferences/com.apple.LaunchServices/com.apple.LaunchServices.secure.plist

Assuming you've setup all of your apps' "Open With" settings, you can ensure that they're not permanently overwritten by removing write permissions from the above file:

chmod 444 ~/Library/Preferences/com.apple.LaunchServices/com.apple.LaunchServices.secure.plist

It kind of works.

I tested this using a .docx file. I set my "Open With" preference to Pages.app and then removed the write permission of the LaunchServices plist file. I found that despite changing the permissions of the preference file, I was still able to change the .docx's "Open With" preference to Microsoft Word. However, after restarting the machine the setting was reverted to the one in the "com.apple.LaunchServices.secure.plist" file as it couldn't write the new data to the file.

I assume OS X stores in memory the "Open With" information if it can't write to the LaunchServices file, which is lost after a restart.

Not a great solution and I hope there's a better one, but it's a start.

You can revert the change by running this command:

chmod 644 ~/Library/Preferences/com.apple.LaunchServices/com.apple.LaunchServices.secure.plist

  • Clever approach. I assume this would be undone the next time it's necessary to repair permissions on the volume, though. – Sasha Vodnik Jan 24 '15 at 4:41
  • This would disable you from setting other and new applications as the Default app, I assume. – Danyel Jan 3 '18 at 6:21
0

i made some checks, in my place the otherwise well done App 5kplayer has had been the culprit of always reassigning the file extensions like .m4v and .mp4 to itself, always overriding e.g. QuickTimeX. But doing so it needs to have a registered Extension inside: ~/Library/Preferences/com.apple.LaunchServices/com.apple.LaunchServices.secure.plist

So i edited this file by search "com.digiarty.5kplayer" and replace with "com.apple.quicktimeplayerx", once i did so, the 5kplayer does not reassign anymore. The console log hints me to think like the 5kplayer replaces existing assignments using it's own from there, and once it is not inside there anymore it cannot anymore.

problem 13:10:20.289435 +0200 5KPlayer Faild to get owner UUID for url: error: fehler 13:10:23.866907 +0200 5KPlayer errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled} fehler 13:11:36.399498 +0200 5KPlayer errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}

Well so before, always when i started 5kplayer, it did reassign all related extensions to itself, which was annoying, NOW it does not anymore and ls -la ~/Library/Preferences/com.apple.LaunchServices/com.apple.LaunchServices.secure.plist

-rw-r--r--@ 1 htr staff 47160 3 Okt 13:05 /Users/htr/Library/Preferences/com.apple.LaunchServices/com.apple.LaunchServices.secure.plist is still user writable ...

-1

The easiest way to change the default application back is for each file type (mp4, etc…); select the file then select File > Get Info from the menu bar, then under the Open with section select the application you would like to use, then select Change All…

  • Really? I know how to change, what I want is to disable it for some extensions. – jherran Jan 21 '15 at 7:12

You must log in to answer this question.

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