Search code examples
objective-ccocoaspotlight

Add files to your application in Spotlight


I create an application for mac os x, the application editor, created a text file of its own format, which you can write/read, etc. How to make the indexing of these files in the Spotlight, so that when you type in field Spotlight in results displayed my files? I would be very grateful for links or code project


Solution

  • Thanks to Jim Matthews for your answer: You can include the Spotlight Importer for your file format in your application bundle, in the Contents/Library/Spotlight folder. Xcode includes a template for Spotlight Importers: choose File > New > Target, select macOS, and choose the Spotlight Importer template. See also Troubleshooting Spotlight Importers