The general question: when I don't own a particular file format, but no UTI has been defined for it by someone else, how do I use that file format?
The specific situation: I'm creating a QuickLook plugin for .torrent and .nzb files. (Note: .nzb files are similar to .torrent files, except instead of pointing to a bittorrent tracker, they point to a Usenet server.) I want the plugin to display what data the .nzb/.torrent file points to, what files would be downloaded if they were opened, and any other applicable metadata. To do this, I have to set forth the Uniform Type Identifiers for these two filetypes. While .torrent files have a designated UTI of com.bittorrent.torrent, .nzb files do not - the NZB format is defined by newzbin.com, which doesn't publish its own application (and therefore doesn't define a Mac OS X Uniform Type Identifier for me to use).
The options seem to be:
CFBundleTypeExtensions in my Info.plist file. This seems wrong too, because not only is CFBundleTypeExtensions deprecated per Apple's documentation, but I don't think I can mix use of CFBundleTypeExtensions and LSBundleContentTypes (if LSBundleContentTypes is present, as it must be for me to use the com.bittorrent.torrent UTI, then CFBundleTypeExtensions is ignored). What's the right thing to do in this situation?
Try using the mdls command line utility to find a .nzb file's UTI.
For example performing mdls on this QuickTime movie clearly shows its UTI, boxed in red below.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With