2

I'm using a Document Based App template in Xcode 10.1 with Swift. Out of the box, it doesn't support many file types, so I have added a number of Document Types including various Microsoft Office formats (doc, xls, ppt) which work fine. I have also added the open xml formats for docx, xlsx, and pptx. These also work fine with the exception of pptx which remains greyed out when running the app. I have also tried using the imported UTI section with no success. Here is an extract of the Info.plist, showing the docx and xlsx entries (which work) and the equivalent pptx entry which doesn't work.

These work:

 <dict>
    <key>CFBundleTypeIconFiles</key>
    <array/>
    <key>CFBundleTypeName</key>
    <string>wordx</string>
    <key>CFBundleTypeRole</key>
    <string>Viewer</string>
    <key>LSHandlerRank</key>
    <string>Alternate</string>
    <key>LSItemContentTypes</key>
    <array>
        <string>org.openxmlformats.wordprocessingml.document</string>
    </array>
</dict>
<dict>
    <key>CFBundleTypeIconFiles</key>
    <array/>
    <key>CFBundleTypeName</key>
    <string>excelx</string>
    <key>CFBundleTypeRole</key>
    <string>Viewer</string>
    <key>LSHandlerRank</key>
    <string>Alternate</string>
    <key>LSItemContentTypes</key>
    <array>
        <string>org.openxmlformats.spreadsheetml.sheet</string>
    </array>
</dict>

Whilst this doesn't:

    <dict>
        <key>CFBundleTypeIconFiles</key>
        <array/>
        <key>CFBundleTypeName</key>
        <string>powerx</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>LSHanderRank</key>
        <string>Default</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>org.openxmlformats.presentationml.presentation</string>
        </array>
    </dict>

I've also tried an imported UTI with no success:

<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
<string>public.content</string>
</array>
<key>UTTypeDescription</key>
<string>powerpoint pptx</string>
<key>UTTypeIconFiles</key>
<array/>
<key>UTTypeIdentifier</key>
<string>org.openxmlformats.presentationml.presentation</string>
<key>UTTypeTagSpecification</key>
<array>
<string>pptx</string>
<string>application/vnd.openxmlformats-officedocument.presentationml.presentation</string>
</array>
</dict>
</array>

Any help would be appreciated, thanks.

Taz Evans
  • 37
  • 1
  • 7

1 Answers1

0

The UTI identifier for ppt files is com.microsoft.powerpoint.​ppt, as per the documentation here.

Therefore you could try:

<dict>
    <key>CFBundleTypeIconFiles</key>
    <array/>
    <key>CFBundleTypeName</key>
    <string>powerx</string>
    <key>CFBundleTypeRole</key>
    <string>Viewer</string>
    <key>LSHanderRank</key>
    <string>Default</string>
    <key>LSItemContentTypes</key>
    <array>
        <string>com.microsoft.powerpoint.​ppt</string>
    </array>
</dict>
atineoSE
  • 3,597
  • 4
  • 27
  • 31