Allow Spotlight to Index PDFs in Scrivener Documents

As we all know, Scrivener is utterly, completely and totally excellent for managing our research sources as we write, and I tend to add in many PDFs to my scrivener projects (academic writing). Indeed I tend to create Scrivener projects to manage research topics. Search within Scrivener is great, with text search of all research + draft documents and the ability to create those übercool binder collections.

BUT, once a document is moved to Scrivener, it disappears from the system! Spotlight indexing only works for the main draft text. This means either lots of duplication of documents or “lost” documents.

I asked technical support previously, and AmberV didn’t think there was anything the user could do to enable this:

Getting Spotlight to index PDFs within Scrivener bundles?

I tried to try to create a script to traverse scrivener documents and soft-link the PDFs but didn’t get very far as a workaround because I thought this was not possible from Scrivener due to technical reasons. However, kewms reminded me that Devonthink can index PDFs within its document bundles, and this is [possibly] a decision made by the developer:

Future of Scrivener?

So, what I would love is the ability to export the text of PDFs to spotlight along with the draft text, so that the PDFs are “visible” once again to OS X. I wouldn’t mind that they had ambiguous numerical names (as they do in the scriv bundle), as long as they were searchable! This is a substantial impediment to keeping all my resources organised and available from the Scrivener-centric perspective (i.e. I don’t want to have to use Devonthink).

PDF files inside a Scrivener project are indexed by Spotlight - their text is included in the project’s general search indexes, so that if you search for some text from the PDF file in Spotlight, Spotlight will return the .scriv project. It won’t return the actual PDF file, though - for that you will need to open Scrivener and search for the text inside the project that was returned. I don’t think it’s possible to have a Spotlight importer return files inside a file package, only the package itself (DevonThink doesn’t use packages) - but even if it were possible, I wouldn’t want to allow this. The innards of a .scriv package should be opaque. We are very open about the format so that users know their files are retrievable in the worst circumstances, but we don’t encourage users to poke around in there and wouldn’t want to.

All the best,
Keith

Ahhhhh!!! I had tested this at some point in the past and it never worked (who knows why), so assumed it still didn’t. Just tested it now and it is indeed working!!! :laughing:

Yes, I’m happy with the compromise that the spotlight search returns the scrivener bundle, and I can then search that using scrivener itself.

One small tweak if it is possible: When I search for a word in spotlight and then open a PDF search result item — preview “knows” the search word and it is already entered into the search field (though it is a bit buggy). Could Scrivener do the same thing?