I'd really like to have a way to integrate with Spotlight in the interim. Understood. I supported Spotlight importers back in the day, and as part of that I created infrastructure to make the whole task easier. I never got around to shipping that as sample code that because I expected CSImportExtension would come online and make it redundant. It seems like I was overly optimistic )-: My code was written in Objective-C, but I spent yesterday converting it to Swift [1]. There are two parts to this: QCFPlugIn — This is a generic mechanism for building different types of CFPlugIn implementations [2]. QSpotlightPlugIn — A type-specific subclass that handles Spotlight. QCFPlugIn.txt QSpotlightPlugIn.txt To use this, subclass QSpotlightPlugIn: private final class MySpotlight: QSpotlightPlugIn { override func importFrom(_ url: URL, type contextTypeUTI: UTType, updating attributes: NSMutableDictionary) throws { … your code here … } } and then invoke the infrastructure from your entry point: @_cdecl(MySpotligh
Topic:
App & System Services
SubTopic:
General
Tags: