Lion Versions

What about a Lion’s feature like Versions? You know, clicking on the title on the top of the window and going into that beautiful time-machine for documents…

This isn’t really an option for Scrivener (we’re getting asked this a lot). To explain:

There are two types of window-based programs on OS X, essentially:

  1. Document-based programs. These are programs in which you work on different documents in different windows, such as TextEdit, Pages, Word and so on.

  2. Shoebox applications. These are programs that have a single window interface that allows you to manipulate multiple files. Examples are iTunes, iPhoto and suchlike.

Lion’s new “Versions” feature works for programs of type (1). Scrivener is, technically, of type (1) - each project you work on opens in a different window. However, Scrivener is a bit of a mix - it also has aspects of type (2), because each project contains multiple files, and the binder gives you access to them.

One of the main differences between document-based programs and shoebox applications is the way they save. Document-based applications tend to save the entire document every time they save. Every time you save a Pages, TextEdit or Keynote file, the entire file is written to disk. Shoebox applications, on the other hand, can contain a lot of data - you wouldn’t want your entire iPhoto or iTunes library to get rewritten to disk every time you added or edited a photo or song. So instead, shoebox applications only ever save to disk the changes made - the particular song you’ve added or photo you’ve edited - along with any necessary meta-data.

In this regard, Scrivener’s saving mechanism is much more like a shoebox application. In order to support the importing of research documents - PDF files, image files, movie and sound files and anything else - Scrivener uses a saving mechanism more inline with shoebox applications than document-based programs. When you load a .scriv project, all that gets loaded into memory is the binder structure, the search indexes, and any files that are open in the editor. When you click on another file in the binder, only then is it loaded from disk and into memory. That way, even if you have a project with a gigabyte of research in it, Scrivener can load fast and won’t slow to a crawl, which it would if it had to load and hold in memory a gigabyte of data. Every time you make a change to a document in a Scrivener project, Scrivener takes note of the fact you have changed that document. At the first opportunity - after the autosave delay and no activity - Scrivener saves any files it notes as having changed to disk along with the updated binder structure. All other files that weren’t changed are untouched. So, if you have a project containing a 1,000 files and only change two of them, only those two will be saved to disk during the next save cycle. This keeps things very fast and reduces the risk of data corruption. In this way, Scrivener can support large projects and not worry about how many files the user is importing.

And this saving mechanism is why Scrivener is incompatible with Versions; Versions and Lion’s new autosave feature are inseparable, and both are built for use with document-based applications and rely on the program saving the entire document to disk each time there is a save or autosave.

In other words, to support Versions, Scrivener would have to load the entire contents of the .scriv file into memory on project load and save the entire contents of the .scriv file every single time you save or autosave kicks in. It would therefore need to ensure that .scriv files never grew too large, or else everything would become unusably slow; it would, essentially, need to completely drop one of its core features - the ability to import as much research as you want, of any file type.

So ultimately, the choice is between Versions and Scrivener’s research capabilities, and I think the advantages of the latter by far trump those of the former; users would be up in arms if I no longer allowed them to import research, or limited the amount of research they were allowed in any one project. Fortunately Scrivener has its own snapshots feature, though, which goes some way to making up for the lack of Versions support (and no, it’s not possible to have Versions work with individual documents within the project - Versions isn’t set up that way; it’s the entire project or nothing).

I hope that explains the situation.

All the best,
Keith

Yes, thanks for the explanation. Since scrivener is essentially a folder system with rtf (and other) docs, would it be possible to apply lions autosave and versions to the documents in any .scriv project, but not the project itself? This way we would get versioning (basically auto snapshots) of the docs we create in scrivener, but the entire .scriv file (that is the metadata database) would continue to act as before. Because the interface for the lion versions feature is the app itself, it would not matter that the .rtf files that make up the text of a scrivener project are not accessible outside scrivener. I’m sure you’ve thought of this, but I thought I would throw it out there.

Thanks for all your hard work. The list of tweaks for 2.1 is impressive.

I’m afraid that’s not really possible. Versions works on the entire program’s project/document saving system, and in Scrivener that’s the main project window and .scriv file. There’s no way just to have it operate on single files within the project.

Earlier today I bought and submitted a tech support incident to Apple asking for help on this, to see if there is any way Scrivener can support versions - seeing as the documentation doesn’t provide anything that helps with cases such as Scrivener’s, I figured I’d get help from the engineers themselves to make sure.

Thanks,
Keith

I understand that Scrivener is not designed to support Versions, and I am not willing to give up the ability to add umpteen files to the research folder. :slight_smile:

I use a product called Forever Save http://tool-forcesw.com/foreversave/ which helps me maintain different versions of the same Scrivener document. Yes, it does take up a lot of disk space. But it gives me the mental peace of knowing that I can go back to any previous version I was working on at any time and not worry about it. And it saves versions of the whole file. Everything.

It does eat up disc space, but it is absolutely a god-send to me.

MacOSX Guru

:question: Actually, that’s what Scriveners “Snapshot”-Feature is for.

I have not looked at the Snapshots feature in Scrivener. Based on the comments here it seems I need to look into that. The advantage of Forever Save to me is that it performs backups on multiple programs. I have it backing up BBEDit, Ulysses, Scrivener, Byword and iA Writer files.

But I need to look at the Snapshots feature. Thanks for that input.

MacOSX Guru