My application uses a text file with an extension of .dssfilelist. On Linux I would register the Mime type and associate it with the application in the .desktop file.
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="text/dssfilelist">
<comment>DeepSkyStacker file-list file</comment>
<glob pattern="*.dssfilelist" />
</mime-type>
</mime-info>
I believe that I need to add stuff to the Info.plist for my application, but I also understand that CFBundleTypeExtensions is deprecated.
So please could you show me what I now need to add to the Info.plist file so that these files will be registered as "text/dssfilelist" type and associated with my application and to associate a .icns file with it?
The best way to deal with this is in Xcode. Specifically, if you bring up the target editor for an app target, the Info tab has slices labelled Document Types, Exported Type Identifiers, and Imported Type Identifiers.
My advice above still stands even if you’re not using Xcode. In that case I recommend that you use Xcode to set things up how you want them, then look at the resulting Info.plist
to see what it did.
Another good trick is to look at how other apps do this. I’ve included an example of that below.
Current documentation for this stuff is in Bundle Resources > Information Property List > Data and storage. That’s very… well… focused, which is why I tend to lean into Xcode. If you’re looking for more conceptual stuff, the legacy docs are generally OK. This stuff hasn’t changed significantly since it was introduced.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
% plutil -p /Applications/Pages.app/Contents/Info.plist
{
…
"CFBundleDocumentTypes" => [
0 => {
"CFBundleTypeName" => "com.apple.iwork.pages.document"
"CFBundleTypeRole" => "Editor"
"LSDefaultShareModeCollaboration" => 1
"LSHandlerRank" => "Owner"
"LSItemContentTypes" => [
0 => "com.apple.iwork.pages.pages"
]
"NSDocumentClass" => "TPMacDocument"
"NSDownloadsUbiquitousContents" => 1
"NSIsRelatedItemType" => 1
"NSUbiquitousDocumentUserActivityType" => "com.apple.pages.documentEditing"
}
…
]
…
"UTExportedTypeDeclarations" => [
0 => {
"UTTypeConformsTo" => [
0 => "com.apple.package"
1 => "public.composite-content"
]
"UTTypeDescription" => "Pages Document"
"UTTypeIcons" => {
"UTTypeIconText" => "PAGES"
}
"UTTypeIdentifier" => "com.apple.iwork.pages.pages-tef"
"UTTypeTagSpecification" => {
"public.filename-extension" => [
0 => "pages-tef"
]
}
}
…
]
"UTImportedTypeDeclarations" => [
0 => {
"UTTypeConformsTo" => [
0 => "public.data"
1 => "public.composite-content"
]
"UTTypeDescription" => "Microsoft Word Macro-Enabled template"
"UTTypeIdentifier" => "org.openxmlformats.wordprocessingml.template.macro-enabled"
"UTTypeTagSpecification" => {
"com.apple.ostype" => [
0 => "DOTM"
]
"public.filename-extension" => [
0 => "dotm"
]
}
}
…
]
}