18

How can I write the CFBundleDocumentTypes property of my .plist file, to allow the app to be displayed in the "Open in..." dialog in the other applications?

That's mine, but it doesn't work

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeIconFiles</key>
        <array/>
        <key>CFBundleTypeName</key>
        <string>Readings</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>text.csv</string>
        </array>
    </dict>
</array>
ctietze
  • 2,805
  • 25
  • 46
albianto
  • 4,092
  • 2
  • 36
  • 54

2 Answers2

51

Found it: public.comma-separated-values-text

albianto
  • 4,092
  • 2
  • 36
  • 54
0

Please consider the general UTI provided by Apple (here fig 1-2). In your case public.text should be enough, but you might be interested into public.composite-content if you want handle for instance .doc and .docx files as well.

Your code might be modified as follow

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>Readings</string>
        <key>LSItemContentTypes</key>
        <array>
           <string>public.text</string>
           <string>public.html</string>
        </array>
    </dict>
</array>