File contents disappeared


I have a large project that I just opened and the content of most of the files has disappeared. There seems to be content from the text icon of the file, but when i click on it, there is nothing there. Then the icon goes blank as if there is no content.

The most recent files I wrote were untouched, as were some of the oldest.

Any suggestions?

When you say files, do you mean documents in the Draft folder? Was the missing content created within Scrivener, in the text editor? And was the project saved to your local hard disk, or elsewhere? Was it backed-up, and if so are the back-ups also lacking content?

Do you suspect this has been a problem for a while, unbeknownst, or did you just notice it happen? Stepping back to an earlier backup from the last good session you had will probably be good enough to resolve the problem in the case of the latter. If it’s been damaged for a while, it could be all of the good backups are expired (though if you use Time Machine you might be able to step back further in time).

Any details you can provide on where the project is stored? This sounds to me as though the files that Scrivener uses to store the data itself have been wiped. The icon having text before you click on it indicates that the search index still thinks the file exists. When you click, the search index synchronises with reality, and with no underlying file it resets to empty. That is a pretty strong indicator that the files were erased from the drive without Scrivener’s intervention. So if this project is stored in a location where any third-party tools might be messing with it behind Scrivener’s back, that would be the first thing I would investigate. Synchronisation, network drives and applications that promise to keep your Mac clean are the usual suspects. Cleaning utilities do not typically touch user data without asking, but I have come across at least one that was pre-configured to periodically wipe out Desktop files that had grown stale, and it was removing pieces of someone’s project even while they were working on it.

Thanks for the responses.

I think AmberV has the right idea, but I don’t know why the files would be stored elsewhere. But here’s another clue: I was using a network back-up disk (via airport) and that back up failed. I had to start a new back up. In the meantime, I rewoke an older back-up on an external hard drive. All the time machine back-ups after that had the same problem. The back up from the last time I used that drive was a month old. Works fine but is sadly old news.

But here’s the weird thing - only this one Scrivener project was affected. I have a number of others than didn’t lose anything.

So my question is - why would Scrivener save a project file on my laptop harddrive, and put data anywhere else? I certainly didn’t ask it to do that. And if it does, can I search for the data that goes with this project?


So the deletions/corruption appeared after you restored the project from an external hard drive? I wonder if somehow or another there was a problem when that back-up was made.

If you can find any old copies of just those files in one project, you could copy that .scriv somewhere convenient and open it alongside the present-tense project, dragging only those elements from one to the other this missing. If you can’t find anything with that material, then restore one of the copies from right before when you noticed the problem. Like I said before, one of the symptoms is that the search index thinks there is text, which is a good thing. That means in at least some of your backups, before you clicked on anything, the search index has a complete (sadly plain-text only, however) copy of your text archived. What you’ll need to do is crack open one of these backups in Finder, by right-clicking and choosing “Show Package Contents”. Go into the Files sub-folder, and open the ‘search.indexes’ file in a plain-text editor (TextEdit is fine). It’s an XML formatted file, but fortunately the XML is very basic and easy to read around. Search for the binder titles of the missing items, and you should see the text for those entries nearby, in a “…” field. A typical entry might look like:

<Document ID="382"> <Title>Name as Visible in Binder</Title> <Text>The main text content of the item...</Text> <Notes>Anything in the Document Notes inspector pane...</Notes> <Synopsis>Card text...</Synopsis> </Document>

So worst case scenario, nothing left in all of your backups, you should be able to get the raw text out of that search index. Once you get a search.indexes file that looks good. I’d set that aside in Documents so that you have it handy in case you find other spots that are damaged, in the future.

It wouldn’t do that unless some really bizarre steps were taken intentionally (no way that could be done accidentally). What I meant was more along the lines of any type of software that might be meddling with the Scrivener project files without Scrivener’s knowledge. Dropbox, for instance, which sits on top of a folder and mediates every single change to a server (or from a server), is capable of changing files behind Scrivener’s back. So long as it does so in a cohesive way where the whole project is altered as Scrivener left it—on another machine—this is okay.

Thanks so much AmberV. I did lose the files, but the search.indexes file indeed has everything in it.

The only question left is “how did this happen?”

I honestly don’t know. I’m pretty sure it’s something that happened to the project one way or another—data loss because of a Scrivener code error is pretty rare, and it would be weird that it mimics what it is like to go into the project bundle and delete RTF files. So I lean toward that, but really I don’t know.

Something you might want to do is periodically make your own backup to some separate place (I like to use Dropbox for this). The File/Back Up/Back Up To... menu command makes that really easy to do. The advantage is that unlike the automatic backups and Time Machine, they’ll be static files that won’t be swept away eventually. So in a case like this where stuff goes missing from months ago, you should have a copy somewhere that is easier to retrieve than the search index.