How to search all scrivener files??

What version of OS X are you using? I tried testing some string searches that I know to be in certain projects and I was able to locate the project by typing in that string. This is on 10.8.

Maybe the Spotlight index needs to be rebuilt?


There are some geekier (non-GUI) ways to go about this as well, as the Mac UNIX environment has some rather powerful searching tools that go into the actual data rather than using an index. You could scour all of the ‘search.indexes’ files on your disk for a phrase. Copy and paste the following into Terminal, replacing SEARCHSTRING with whatever text you’re looking for, don’t remove the quotes around it though:

find ~ -name search.indexes -print0 | xargs -0 grep -F -i -l 'SEARCHSTRING'

That will locate every Scrivener search index within your home folder (everything, including trash) and then send that list of files to a search program that will scan for the literal phrase, case-insensitive, printing the name of each file that matches.

You’ll probably get a whole bunch of “Permission denied” messages (especially if you search the whole computer) that can be ignored. What you’ll be looking for are lines like this:

/Users/YourNameHere/Documents/Queen.scriv/Files/search.indexes

So from that we can see that ‘Queen.scriv’ is located in your user Documents folder.

Tips

  • If you want to search just external drives, change the ‘~’ to ‘/Volumes’. Search time will escalate quite a bit if you have something slow like a flash drive or optical disc mounted.
  • Change the ‘~’ at the beginning to ‘/’ to search everything, even external drives, but be prepared to maybe take a nap in the meanwhile. :slight_smile: