Mac App D&D Any File onto Dock (but never be listed as default viewer by the OS)
To allow D&D onto the Dock Icon you specify in your info plist what kind of files you app can handle - you specificy * for ANY -- easy peasy
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
</array>
<key>CFBundleTypeName</key>
<string>info.pich.imagable.description</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
BUT that will make the OS list your app as a potential viewer for ANY file and if there is no other better viewer, your app takes over the role of the default viewer :( [if it makes sense ok, but in most cases this doesn't]
therefore, specify your RoleRank! Set it to none to accept D&D but remain ignored otherwise:
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
</array>
<key>CFBundleTypeName</key>
<string>info.pich.imagable.description</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>None</string>
Written by Dominik Pich
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Osx
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#