Following this document, indeed only an entry in the application's plist is needed: In the document type entry, the key LSTypeIsPackage
must be included with value "true"
:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeName</key>
<string>Foobar Document</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>foobar</string>
</array>
<key>LSTypeIsPackage</key>
<string>true</string> <!-- !!! -->
<key>CFBundleTypeIconFile</key>
<string>foobar.icns</string>
</dict>
</array>
I had to copy the application to /Applications
for the Finder to recognise my new file type, but then it worked, and the directories ending in .foobar
are shown as opaque files.