Reputation: 63369
I'm trying to export a UTI in my application, but macOS (10.3.2) is not picking it up. I've replicated my issue in a smaller project. Here's the relevant part of info.plist
:
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.plain-text</string>
</array>
<key>UTTypeDescription</key>
<string>Demo of custom file support</string>
<key>UTTypeIconFile</key>
<string>File-512</string>
<key>UTTypeIdentifier</key>
<string>am.customfiledemo.demotxt</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>demotxt</string>
</array>
<array/>
</dict>
</dict>
</array>
I've tried rebooting, and even rebuilding the launch services database, to no effect:
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain ststem -domain user -v
When I check my file's UTI with
mdls -name kMDItemContentType -name kMDItemContentTypeTree file.demotxt
I get a dynamic (dyn.*
) UTI, rather than am.customfiledemo.demotxt
kMDItemContentType = "dyn.ah62d4rv4ge80k3prr74hu7a"
kMDItemContentTypeTree = (
"dyn.ah62d4rv4ge80k3prr74hu7a",
"public.data",
"public.item"
)
Upvotes: 4
Views: 923
Reputation: 63369
Make the UTI conform to public.data
, or com.apple.package
:
Although a custom UTI can conform to any UTI,
public.data
orcom.apple.package
must be at the root of the conformance hierarchy for all custom UTIs that are file formats (such as documents); otherwise, the system can’t tell if an item on disk has that UTI.
Upvotes: 2