2

I have successfully registered my app to open PDF files by including the following in my info.plist:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>PDF</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.adobe.pdf</string>
        </array>
    </dict>
</array>

However, I cannot seem to register my app to open any image files, I have tried to register not only for the base image UTI, but also specific types like png and jpg. Is it possible to register to open image files?

RunLoop
  • 20,288
  • 21
  • 96
  • 151

3 Answers3

2

Bad news - cannot be done. Wish these things would be stated in the docs.

RunLoop
  • 20,288
  • 21
  • 96
  • 151
1

open plist with Source code and add this for document.

<dict>
            <key>CFBundleTypeName</key>
            <string>All Files</string>
            <key>CFBundleTypeIconFiles</key>
            <array/>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.data</string>
                <string>public.content</string>
            </array>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>LSHandlerRank</key>
            <string>Owner</string>
        </dict>

i hope this usefull for you.

Jashu
  • 1,061
  • 13
  • 19
-1

Open the plist with an editor...

Capitalization, etc is critical, recommend specifying both lower case and upper case file extensions.

<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>jpg</string>
<string>JPG</string>
</array>
<key>CFBundleTypeName</key>
<string>Images</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>

Then save the file. App should now be registered to handle this type of file.

sean808080
  • 242
  • 4
  • 13