macOS Quick Look extension for .toml files. Right-click any .toml file and select "Quick Look" to preview it as plain text.
-
No standard
.tomlUTType: macOS doesn't export a publicpublic.tomlUTType. Solution: Created customcom.hippietrail.tomland exported it via the host app's Info.plist. -
UTType export not working with generated Info.plist: Xcode's
GENERATE_INFOPLIST_FILE = YESdoesn't properly handleINFOPLIST_KEY_UTExportedTypeDeclarationsarrays. Solution: Switched to manualInfo-generated.plistwithGENERATE_INFOPLIST_FILE = NO. -
Extension not loading files: Initial implementation didn't read file contents. Issues were:
- Missing NSTextView outlet connection in XIB
- Need to explicitly wire outlets in the NIB file for QuickLook extensions
- File read had to happen on main thread via DispatchQueue
xcodebuild build -scheme tomql-host-app
qlmanage -r # Reset QuickLook daemon
qlmanage -p /path/to/file.tomlOr in Finder: Right-click .toml file → Quick Look (spacebar)
tomql-preview-extension/PreviewViewController.swift- Loads & displays TOML as texttomql-host-app/Info-generated.plist- Declares customcom.hippietrail.tomlUTTypetomql-preview-extension/Info.plist- Extension configurationtomql-preview-extension/Base.lproj/PreviewViewController.xib- Text view UI