Spotlight Search doesn't index inside projects

The same thing occurred for a while two or three Mac versions ago, and it’s back. I should be able to spotlight search for “Skiirl” and find project RTFs containing that word. Spotlight should also find RTF files by name or kind.

But neither works.

Is that because we’re missing a Spotlight utility capable of interpreting Scrivener?

Is it just me, and it works for everyone else?

I’m not sure if this has ever worked out of the box, at least precisely as you are describing. There are times where it may appear to work (and for a while I thought it did!), and I think that’s when the word you’re looking for ends up in the Quick Look preview for the project. Even then it still only selects the project as a search result, not the internal .html file used to generate the preview, let alone the storage container where the data itself came from. There is a good reason for why Spotlight does not trawl into and select component files from package formats—they arguably shouldn’t be package formats if that is desirable.

I’ve used Spotlight to find text inside projects MANY times. It finds documents (RTF) that include the text, not just a project. It’s useful, and it absolutely works.

Except when it DOESN’T. It has failed for weeks, maybe months at a time after a macOS update and, for some file types, it also depends on a helper (wrong word, but I can’t remember the right one) for that type, but that doesn’t apply to packages, and I doubt it applies to Scrivener projects (since they’re only packages). It works for DOCX — which are Zip files — and I’m sure it’s possible to search package contents from Terminal, though I’m not too interested in doing it that way.

That said, it’s not a Literature & Latte problem if you’ve never created a helper for it, and it may never work again if Apple decides not to resurrect it.

Find Any File supposedly does what I want. I’ll have to try it.

Apple may restore this functionality to Spotlight, but there’s no guarantee of that.

Update: yes, Find Any File does the job. It doesn’t use an index, so it’s slow … but it works.

Yeah, like I say I’m pretty sure it is Apple’s intention for package internals to not be indexed unless specifically told to, but I could be wrong about that (I’m hardly a Spotlight expert, as I have it completely disabled on my systems). What I do know, having refreshed my memory from my notes, is that it should be using the project’s own search index file to provide terms, and to present the project as a search result if anything you type is found in its index.

When it does work as you describe, how does it work? Does it actually load the RTF file itself into TextEdit or whatever—because that’s exactly the kind of thing that should not be easy to do accidentally. If it loads the host project though, then that sounds a lot more reasonable and even intentional (as that surely wouldn’t be a natural result).

Off topic, and not intended to derail the thread, but quick q for Ioa - what do you use instead of Spotlight?

I use LaunchBar for the kind of stuff where I’m looking to locate a particular resource quickly, and do stuff with it. If you’ve used QuickSilver or Butler, it’s a lot like that. It has an optimised self-training index of everything you want it to index (so after a few hits it knows that when I type in nothing more than ‘s’, I want Scrivener :wink:). It also optionally provides a categorical search mode, where I can start out by saying I want to find a PDF file, and then go on to type in a few letters from the filename I want—that helps to make searches very precise. Typing in ‘scp+’ is enough to narrow my search down to Scrivener Projects alone, and after that I need only type in the bare minimum number of letters or numbers it takes to distinguish the project I’m looking for from the rest.

But where it really goes beyond Spotlight is in what you can do with those results. I can target a .txt file in a folder and hit ⌥⌘C to copy its contents to the clipboard without even opening it, or hit Tab and send the text of it (or even the whole file itself) to any other program, folder, registered Service, built-in action (it has tons of tools like title case conversion, and the ability to make your own) and so on. Or I can compress the Scrivener project into a zip file right then and there, and then fire the .zip off to my email client as an attachment to a specific contact card address. You can also load Web searches into it—I have one for example that I trigger with ‘lnlfw’ which searches for “LnL Forum Wish List” posts, via the advanced search flags here (you can guess why I have a hard-coded search for that :laughing:). So yeah, all around it is a bit of Swiss Army file management, locator, glue-between-programs, snippet tool, clipboard manager, you name it, tool.

For the stuff it doesn’t do (content level indexing), I use the command-line. I don’t often need that, to be clear. It’s pretty rare that I run a recursive grep or find command. I suppose that is one reason for why I’ve never found Spotlight to be terribly useful. Content just adds an unstoppable flood of chaff to every search, if you don’t really depend on it. For myself, for the types of things that depend upon content level searching, I put those into programs that specialise in that, like Scrivener and DEVONthink.

There are downsides to switching Spotlight completely off. Finder loses some of its search functionality (which I always found mildly ridiculous, that it needs a heavy-weight search index to filter a list of files in a folder by name, but hey, that’s Apple for you—building Space Pens where grease pencils would do), and now and then I encounter software that depends on a Spotlight index for something. But none of that really matters much to me—I don’t actually use Finder much either.

There are good reasons to shut it down though, if you don’t use it. It’s a resource hog, filling your drive with a massive search index you’ll never use, reducing the lifespan of all attached disks by periodically cruising through every byte, and generally making the Mac slower whenever it is working. Plus, the alternatives aren’t a narrow scoped key-logger, sending every keystroke you type in, geotagged, over the ’net to Apple. That never sat right with me; one’s personal computer searching tools should not have a privacy disclaimer in the fine print.

Thanks for such a comprehensive reply Ioa, will have a look at Launchbar and spend a bit of time digesting your other points!

Like any Finder search, it returns a list of files that match. If I search for kind:RTF document, it returns a list of RTF files. If I search for Content:Skirrl, it returns a list of files (also RTFs) containing that word.