Spotlight Importer

BetterZip 6 includes a Spotlight importer that indexes the filenames inside archives. Once it’s running, you can find a file in an archive just by typing the filename into Spotlight, without opening the archive first.

What gets indexed

For every supported archive on a Spotlight-indexed volume, BetterZip’s importer reads the archive’s directory listing – it doesn’t decompress anything – and writes these attributes to Spotlight:

  • The flat list of every filename inside the archive (stored in kMDItemTextContent, the same attribute Spotlight uses for the text inside a regular document).
  • The archive’s own comment if it has one, in kMDItemComment.
  • Archive format, file count, uncompressed size, and is encrypted in custom com_macitbetter_betterzip_* attributes you can use in Smart Folder rules.

The format list covers the ZIP family (including jar, war, cbz, ePub, ipa, apk, crx, egg), 7z, RAR, the TAR family with every compressor variant (tgz, tbz, txz, tzst, tbr), the underlying compressors on their own (gz, bz2, xz, zst, br), and the long tail of legacy and cross-platform formats BetterZip can read – ARJ, LHA, NSIS, SIT, BinHex, MacBinary, XAR, TNEF, CAB, CHM, ISO, DEB, RPM, CPIO. The full list lives in the importer’s Info.plist.

Encrypted archives that don’t even let you list their contents still get the format and “is encrypted” attributes – the filename list stays out, because BetterZip can’t read it without the password.

To keep Spotlight responsive, the importer stops collecting names after 50,000 items in a single archive.

How to use it

The importer is bundled inside BetterZip and macOS picks it up automatically when the app is installed. Spotlight reindexes matching archives on its own schedule, so there’s nothing to set up.

Search results that match a filename inside an archive show the archive itself in Spotlight – the matched filename isn’t a separate result. Press Return to open the archive in BetterZip; from there, use the toolbar search field to jump to the file inside it.

Additional technical information

The rest of this page is for the curious or for troubleshooting – you don’t need any of it to use the importer day-to-day.

Forcing a reindex

To make Spotlight reindex a specific folder right now instead of waiting for its own schedule:

mdimport ~/Documents/Archives

Where the importer lives

The plug-in is at BetterZip.app/Contents/Library/Spotlight/BetterZip.mdimporter. macOS discovers it via the bundled app; there’s no separate install step.

Disabling the importer

There is no in-app toggle. If you want to stop BetterZip from indexing archive contents, choose one of these:

  • Tell macOS to ignore the importer plug-in:
    pluginkit -e ignore -i com.macitbetter.betterzip.spotlight-importer
    Re-enable later with -e use. macOS stops feeding new archives to the importer right away; existing index entries fade as Spotlight rebuilds.
  • Exclude specific folders or volumes from indexing entirely via System Settings > Spotlight > Search Privacy.

Troubleshooting

  • Search results don’t include archive contents. Spotlight may not have re-indexed your folders yet. Run mdimport <folder> as above, or wait for macOS’ own schedule.
  • External drives don’t surface results. macOS only indexes external volumes if you’ve allowed it under System Settings > Spotlight.
  • Verifying what got indexed. Run mdimport -t -d3 path/to/archive.zip: it prints every attribute the importer emits, including kMDItemTextContent. Plain mdls won’t show kMDItemTextContent – Spotlight keeps that one internal to its search index.
  • After a LaunchServices reset the system may not rediscover the bundled importer. Reopening BetterZip usually fixes it.