0

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

  • 1
    You should read about 1.[Introduction to Spotlight](https://developer.apple.com/library/content/documentation/Carbon/Conceptual/MetadataIntro/MetadataIntro.html#//apple_ref/doc/uid/TP40001280-BBCFBCAG) 2.[Spotlight Metadata Attributes](https://developer.apple.com/library/content/documentation/CoreServices/Reference/MetadataAttributesRef/MetadataAttrRef.html#//apple_ref/doc/uid/TP40001689) – Tommy Nov 15 '16 at 13:20
  • You need to write a [Spotlight Importer](https://developer.apple.com/library/content/documentation/Carbon/Conceptual/MDImporters/Concepts/WritingAnImp.html) for your file format. – Jim Matthews Nov 16 '16 at 16:39
  • @JimMatthews, Sorry, Spotlight Importer - it is in fact a separate application? – Митасов Эдуард Nov 21 '16 at 14:40
  • 1
    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](https://developer.apple.com/library/content/documentation/Carbon/Conceptual/MDImporters/Concepts/Troubleshooting.html). – Jim Matthews Nov 21 '16 at 16:02
  • Thank you very much, you made my day! – Митасов Эдуард Nov 21 '16 at 17:14

1 Answers1

0

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