Synchronizing search string pb !

iMac 2.8 Intel Core 2 Duo 4 Go Ram running Snow Leopard 10.6.2 Scrivener 1.53
I have 2 projects for books I am writing:
1- about 45 Mo
2- about 675 Mo
Long time user of Scrivener I have had the “Synchronizing search string” window a few times on opening Scrivener for different reasons ( computer crash etc…). Takes a few minutes and everything is back in order.
This time I can open project 1 by dragging it over Scrivener icon: synchro and bingo back in business
but when trying to open project 2 ( large one) the same way Scrivener just quits after about 4 minutes of synchro.
Attached file is latest Scrivener crash report
I have multiple copies of this file as I am using Time Machine but have not had much luck with older copies of this project.
Any ideas how to reopen this project ?
Thanks for help
Jean From France (12.8 KB)


It looks as though there is a bad PDF file in there. I’ve seen this on a few occasions. When synchronising search strings, internally, Scrivener goes through each file in the file package, loads it up, and copies its text content into a plain-text database that it can use for searching. In the case of PDF files, the way it does this is like this:

• Load up the PDF file into a PDF view that isn’t drawn on screen.
• Select all.
• Get the string of the collection.

The PDF view it uses is from the PDFKit, which is what is built on top of. It turns out, though, that some very long PDF files, usually ones with variable page sizes, can really choke the PDF kit when it comes to “select all”. It can take ages to go through, and it can eventually run out of memory and crash. This usually happens in Preview with such PDF files, too.

The solution, then, is to find the troublesome PDF file. To do so, do this:

  1. Ctrl-click on the .scriv file in the Finder.
  2. Select “Show Package Contents” so that a window appears showing the files contained inside the .scriv file.
  3. Switch to Finder’s list view and sort by “Kind”, then scroll down to all the PDF documents.
  4. Open each PDF file in (if any are set to be opened in Acrobat, ctrl-click and use “Open with” to open them in instead).
  5. In, hit cmd-A to select all the text.

If freezes or crashes, that is probably your culprit. In that case, move the offending PDF file out of the .scriv folder to somewhere else on your hard drive.

Note that if you have a lot of PDF files in your project, you may wish to sort by “Size” rather than “Kind” and try opening the largest PDF files first, as it is probably a large PDF file causing the problem.

I’ve done some work on this for 2.0. In 2.0, it only ever needs to synchronise the search indexes of files that have been changed during the session after which Scrivener crashed or wasn’t closed properly. This should significantly reduce the chances of this happening and make the whole process much quicker.

Thanks and all the best,

I am answering myself as I have managed to solve the problem, I still don’t know what went wrong !
Using Time Machine I restored an older copy of my project ( the fat one ) but kept the troubled copy
If restored copy opens fine , closed it otherwise try an older one untill you find one that opens no problem
Using “Control Click” I opened both contents and compared them one to the other
I moved to new folder (named it “saved files”) every file missing in restored copy:
1- opened each file in “saved files” with TeachText
2- select all
3- copy
4- past content in opened restored copy of my project
5- close restored project when no more files to import
6- delete troubled copy of project
It might sound a bit boring but I have managed to save a rather large (670 Mo) and very important project
I am still wondering why is this problem happening once in a while ???
Hope this helps

Glad you fixed it. We seem to have cross-posted - see my explanation above for the cause.

Thanks Keith for taking some precious time to answer as usual
I will check on PDF files but this time all files I had to “reimport” where .RTDF type ( 13 files)
Do you feel it is safe to let this project grow to this size (675 Mo of any type except videos) ?
should I split it into smaller .scriv files ?
Thanks for help and keep up the good work, I am ready to buy version 2 when it comes out ( any ideas when ?) as I couldn’t work without Scrivener, don’t let me down !!
All the best
Jean from France

There must be some PDF files in your project because your crash report indicates that the crash is happening when a PDF file’s text is being loaded:

[code]4 0x93840971 +[CPCharacterIndex poulateIndexArrayForPage:to:] + 2126
5 0x9384e6d5 -[CPPage(CPPageSelections) characterIndexes] + 119
6 0x9384e1f1 -[CPPage(CPPageSelections) stringInReadingOrder] + 69
7 0x97035922 -[PDFPage(PDFPageInternal) loadTextChars] + 188
8 0x97032826 -[PDFPage numberOfCharacters] + 93
9 0x9703727c -[PDFPage(PDFPageInternal) selectionForAll] + 134[code]

As I say, this is happening during the re-sync process that Scrivener is doing.

675MB should be fine - I would just be careful about backing up regularly, obviously.

All the best,

Is there a way to find out which PDF was faulty by reading the crash report ?
it might help me for future investigations

If there was, I wouldn’t have asked you to go through the file package - I’m not that sadistic. :slight_smile: That’s the only way of doing it, I’m afraid - the PDF view doesn’t know anything about the file that is loaded into it, only its data. But if you follow the instructions I gave you, you should find the dodgy file.

FileBuddy will allow you to search package contents for a particular file. rtfd files are themselves packages and can include pdfs.