Last Updated: February 25, 2016
·
404
· daij-djan

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>