When the Info window of Finder is used to associate files of a particular type with an application:
- the preference is effective immediately.
When Terminal is used to make a comparable addition to ~/Library/Preferences/com.apple.LaunchServices.plist
- the preference is not effective immediately.
Question
Why does Launch Services not immediately respect a write to the user's com.apple.LaunchServices.plist
?
An ideal answer might be a reference to a page in the Apple Developer area.
Answers need not involve running a command.
Background
Agent or daemon?
Wondering whether a daemon or agent makes changes to that .plist effective, I ran:
sudo launchctl list
In the list, under the label heading, I see nothing that might relate to Launch Services.
References
An answer to Stack Overflow question How to set default application for specific file types in Mac OS X? suggests:
… to be reloaded. You can logout, wait a few minutes or force launchservices to restart …
In my case:
- log out did not have the desired effect
- I used the
lsregister
approach, but that type of scan is time-consuming.
The accepted answer to Super User question Is there a faster way to change default apps associated with file types on OS X? suggests:
… restarting the OS to apply changes (logging out and back in isn't enough) …
— if a restart suffices, that's probably less time consuming than killing then seeding the Launch Services database.
lsregister -kill -seed
doesn't take that long (a few seconds on my Air), but it makes OS X show the warnings about opening applications for the first time again. That's why restarting is generally a less annoying way to apply the changes.