Setting MacOS file attributes or metadata so that QuickLook will recognize .bt (or other specific extension) as ordinary text

It would be handy if MacOS could be persuaded to treat 010 Editor extensions like .bt like other ordinary text files as far as how QuickLook handles them.

While this isn’t strictly a question about 010 Editor, it would be convenient if this can be done.

I believe I’ve done something similar before with file metadata or extended attributes, but don’t recall how.

It looks like we would have to write a QuickLook plugin to support this and does not look trivial. It may be possible to install a generic QuickLook plugin that supports viewing any text file with any extension. This plugin may possibly work but it could be some work to set up:

https://github.com/whomwah/qlstephen

Graeme
SweetScape Software

It turns out to be quite easy to accomplish this on MacOS Catalina for QLStephen or other QuickLook plug-in that already supports plain text. Leaving some bits for the user to fill in, the following short sketch is how I did it:

  • Use the MacOS command line tool mdls to find a sample .bt file’s UTI (Uniform Type Indicator) string.
    $ mdls ~/Library/Application Support/SweetScape/010 Editor/Repository/010Theme.v0.0.1.bt
  • Using a property list editor like ProperTree, (an ordinary text editor including 010, though ones like bbEdit are good for structured text like XML), add that string to the right place in the plug-in’s info.plist file.
  • Force the reloading of QuickLook’s generators and reset the disk cache of QuickLook-created thumbnails:
    $ qlmanage -r
    $ qlmanage -r cache
  • Restarting Finder
    $ killall Finder

I hope other Mac-based users of 010 Editor will find this useful.

(ProperTree is open source. I am not reimbursed for recommending ProperTree, bbEdit, 010 Editor, or anything else.)