How to deal with UTI conflict

I'm developing an application that is supposed:

  1. to open .3mf file (and other file types), and
  2. to provide Quick Look thumbnails for this file format.

Because of (2) I need to add UTIs into my app Info.plist (and to my thumbnailing appex Info.plist). So the app's Info.plist changes are:

  1. into CFBundleDocumentTypes key of 3mf file type adding my custom UTI like this:
    <key>LSItemContentTypes</key>
    <array>
      <string>com.prusa3d.slic3r.3mf</string>
    </array>
  1. Creating UTExportedTypeDeclarations section with UTI metadata for given file type like this:
<key>UTExportedTypeDeclarations</key>
<array>
  ...
  <dict>
    <key>UTTypeIdentifier</key>
    <string>com.prusa3d.slic3r.3mf</string>
    <key>UTTypeConformsTo</key>
    <array>
      <string>public.zip-archive</string>
    </array>
    <key>UTTypeDescription</key>
    <string>3MF</string>
    <key>UTTypeIcons</key>
    <dict/>
    <key>UTTypeTagSpecification</key>
    <dict>
      <key>public.filename-extension</key>
      <array>
        <string>3mf</string>
      </array>
    </dict>
  </dict>
  ...
</array>

Unfortunately this is not working as I've installed Shapr3D app, which registers the same file extension with own different UTI ID like this:

	<key>UTImportedTypeDeclarations</key>
	<array>
    ...
		<dict>
			<key>UTTypeConformsTo</key>
			<array>
				<string>public.data</string>
			</array>
			<key>UTTypeDescription</key>
			<string>3MF</string>
			<key>UTTypeIconFiles</key>
			<array>
				<string>document-icon-64x64.png</string>
				<string>document-icon-320x320.png</string>
			</array>
			<key>UTTypeIdentifier</key>
			<string>com.shapr3d.3d-manufacturing.3mf</string>
			<key>UTTypeTagSpecification</key>
			<dict>
				<key>public.filename-extension</key>
				<string>3mf</string>
			</dict>
		</dict>
    ...
	</array>

So my question is: How can I handle this UTI ID/file extension conflict?

So far I came up with following bad but working solution:

  1. Uninstall the conflicting application,
  2. Use the same UTI ID.

I say "bad solutions" because:

  • The (1) is user hostile/unacceptable approach,
  • the (2) is fragile approach, as there are other applications that may register same file extension with different UTI ID (the .3mf sort of universal file format for 3D manufacturing the other apps are using too).

Replies

Hi,

did you find any solution to that? I also have the same issue. My solution at the moment is simply to set the foreign UTI into my plist as well (mine is org.sidmusic.sidtune):

<key>CFBundleDocumentTypes</key>
<key>LSItemContentTypes</key>
			<array>
				<string>org.sidmusic.sidtune</string>
                <string>pl.rabidus.retrodebugger.sid</string>
			</array>

And set my app as default app for the file type using Finder.

Any further ideas for that?