I’ve got a large [and important!] Scrivener document that I recently closed (accidentally hit Apple-W, oops!), then tried to reopen a few minutes later. When I select it from the “Recent Documents” menu, Scrivener shows me a file-open dialog; when I select the document from the file-open dialog, it fails silently. This is what I’m getting in the system log about the problem:
Jul 31 15:26:40 Hostname-2 com.apple.launchd (com.apple.metadata.mdwrite.plist): Exited with exit code: 1
Jul 31 15:26:54 Hostname-2 Scrivener: *** -[NSCFDictionary mainDocument]: unrecognized selector sent to instance 0x18746ca0
Jul 31 15:27:24: --- last message repeated 3 times ---
How can I get the file open?
First, close Scrivener completely and then reopen it (just to eliminate any possible memory corruption weirdness).
Using the Finder, create a duplicate copy of the Scrivener project (Cmd-D). Then right-click on it and choose
Show Package Contents. Scroll down until you find a file called
ui.xml and then move that to the trash. Now try opening the duplicated project and see if that works. You’ll get a warning message about the file not being closed properly the last time, and the window will look like Scrivener’s default new project settings once it does open (if it does).
If it does, that file got corrupted somehow when it last closed. The file does not contain anything important to the project information itself. It stores state information like which document was open last, splits, and so forth, as well as search indexing (since your project is large, it might synchronise strings for a while before opening). So if this procedure fixed the project for you, feel free to either swap out the new duplicated project as your main working project, or perform the same procedure on the original project to fix it.
Amber has answered this as well as I could - let us know how you get on so that I can look into it further if closing Scrivener and re-launching it doesn’t help. The error messages on the Console suggest there is a memory management bug here, where closing the project didn’t clear it from memory correctly, so hopefully quitting and re-launching will fix that. If not and you still have problems, though, zip up the file and send it to me at support AT literatureandlatte DOT com so I can take a look.
Thanks and all the best,
This worked fine, thanks!
Thanks for the update - this definitely sounds like a memory management bug, then. Are you using Tiger or Leopard?