Compare two Scrivener projects for differences?

Would be really really really helpful if I could have Scrivener compare two projects for deltas (differences) in:

  1. Binder structure and folder document counts.
  2. Date of documents (created, opened in editor, last changed)
  3. Folder and Document sizes.
  4. Compare the same document in two projects (revisions, edits, etc.).

Obviously, I am asking because scrivener has messed up my projects, and I am in recovery mode. But this would be a smashing addition to Scrivener.

The idea would be to combine revision and snapshot affordances and extend to the granularity of folders and nested folders, and then to entire projects themselves.

Thanks, Randall

If you have lots of differences and need to meticulously track them down, you can compile each project to produce a TXT file. For example, Project01.txt and Projec02.txt.

Then, use a product like BBEdit to compare the two files. Every difference will be flagged. You’ll then have to make your corrections back in Scrivener.

It’s a bit of work, but it’s thorough.

These two can be extracted from the .scrivx files of the relevant projects. These are XML files, so any programming editor should be able to compare them without difficulty. Once you have that information, you can extract the specific files that have changed. These will mostly be RTF files, so you can compare them in Word, in Scrivener itself, or in a variety of other tools.

Any tools more on the user-friendly side of things? I am not a geek. I write code but its all for show, no low level stuff. Not used to the kernel side of things or command line terminal stuff. Do you know of any finder like tools that do fast compare stuff at the user level?

Thanks,

Randall

So I take it that Scrivener doesn’t itself offer anything like a project compare or a document compare feature?

What if I were to compile (export) with document titles, my separate projects as TXT files (Proj1, Proj2, Proj3…), and import these txt files back into a single Scrivener project as separate documents in one project binder, and then use one of scrivener’s own compare features like snapshot?

Would that work? Would there be a way to easily see the delta’s between the separate projects once they were imported as binder documents into a single new “Compare.scriv” Scrivener project?

I can imagine opening Proj1 document, taking a snapshot of it, then opening Proj2 and select all, copy, and then opening Proj1 document and pasting that text from Proj2, replacing all of the text in the original Proj1 document, taking another snapshot, then browsing the compared differences between the two snapshots in the inspector pane using the “compare” command.

Has anyone tried this with book length text documents? How does Scrivener perform when comparing snapshot-ed documents which are 300 pages long?

Thanks,

Randall

The only direct comparison tool is Snapshots. So you could take a Snapshot of Document A, then copy and paste the text of Document B. But no, there are no project-level compare features.

Thank you. I will try this “compare” snapshots function after exporting (compiling) the projects I need to compare separately as single .rtf or .txt files. Will let all of you know how this turns out, whether or not Scrivener handles this compare functionality on project sized (300 page) documents.

Here are two different approaches I have taken in the past. I’ve never actually had Scrivener damage a project, but I’ve certainly damaged my own projects inadvertently, by thinking I had the latest version of it but not, and editing in it for a few days before noticing that. If what your looking for matches that profile, regardless of the cause, then try one of these:

Project merge

Documented in §5.3.2, under subheading Merging Changes from One Project into Another, the concept is simple. You open what you consider to be the master project and then from that, use File ▸ Import ▸ Scrivener Project..., targeting the recovery project, or older version. The result of this will be largely automatic, or more akin to synchronisation, in that the software will go through item by item and select the newest version of each item from both projects. This process creates snapshots for each binder item changed in this way, so that both versions will be available for comparison, and it adds each changed item to a Collection for your review.

This method will work best for cases where both versions of the project have independent edits made to them, and both versions came from the same project. That criteria means anything created by duplication in the file system, Save As, automatic and manually created backups or any other way of copying the original project and editing it. So it’s no good if the two projects came from completely different ancestors and you’re looking to merge them.

Date Search

From Project Search, use the “Reset Search Options” command at the bottom of the search options menu, and type a single * into the search field -or- for a more selective approach, if you know the time range to work within, type mdate:1m into the search field, where “1m” means editing within the past month, “8d” would be 8 days.

Next, click the hook arrow button in the search results header bar to move the results over into the main editor, switch to Outliner mode, add the “Modification Date” column, and sort it by descending.

Set that up in both projects, and now you have a fairly easy list of things to walk through. What I find works best, since merging items will bump the modification date, is to in the master project select the chunk of items you know may conflict (I scroll until I hit items that have identical modification dates in both projects), and make a new static collection from that. This way you can use it as a “to do list”, removing items from the collection as you address them.

How you compare the text itself is up to you, but snapshot method is generally the most effective.

Hi! I want to compare two projects (containing the same book idea) that I’ve been working with on two different computers. How do I do this? Ideally I would like to see both where text changes have been made AND where comments are different.

Thanks! :slight_smile:

Occasional faced a similar conflict caused by synch conflicts but is limited to a few documents within a single project. Split the Scrivener window and display both versions (usually forgetting side-by-side and going with above-below requiring more eye movement).

In your situation I would open both projects and tile their windows side by side and work through each document in turn comparing and contrasting. Tedious but workable. Terminal level tools like diff are no use sadly because they work line-by-line and edits in Scrivener could make the lines in the files different but the visual content identical.

Why not use snapshots of different versions, if want to rewrite scene do it and then take snapshot and compare to previous version side by side in editor windows with deletions and additions highlighted. Have windows version, but assume can do on ios version. (could be wrong)

I took it that @parsathil had worked on the two systems independently of each other so (Scrivener) snapshots would not help in the reconciliation process.

For future occasions when this might happen putting the Project on Dropbox and accessing it from each of the computers would result in a single version that requires no reconciliation. Snapshots might not be necessary that way.

You can actually rebuild (or build) them in order to use the snapshot’s compare function.
All one needs to do is copy the content that originated from outside one specific project to the target document. [Take a snapshot of the document, then replace its content with the body text of the second document. ← Best approach would be to do this in a binder duplicate of the original document.]
You can compare a snapshot with a document. (It doesn’t have to be two snapshots that are compared to one another.)
→ You can also copy paste the comparison result from the snapshots panel to a new document for convenience, if needed.

For the comparison of comments though, I don’t see how that could be done.
I guess one would have to have both documents side by side.
(Using two quick reference panels rather than a split editor, you wouldn’t have to go back and forth continually :wink: )

Using two quick reference panels to compare comments - Screenshots

image

Have you tried the Import and Merge feature? See Section 5.3.2 in the manual for more information.

What platform (Mac or Windows) are you working on?

If on the Mac platform, I may have a solution that I’ve used for years to compare thousands of pages of raw Scrivener folders and text files … with the option to view either the full text with the changes highlighted, or just the differences between the documents (my default).

Let me know if you are still looking for another option on the Mac platform.

scrive
:thinking:

1 Like

I would klike to know thanks
Doesn´t look like snapshots can be a part of a text
I have rewritten something several times and now am confused and would like to kind of put it all in one or see the differences
Merge just put the 2 together like I could have done this myself, copy and paste

I’ve written some tips on comparing projects a while back, and a link to an older discussion as well. But I think this will all be more applicable to comparing two whole separate projects, rather than multiple revisions of text within a single project.

That said, there is a fair bit of overlap in technique—particularly in how snapshots can be integral to going through something with multiple layers (whether through revision, syncing or merging) and deciding which is best.

Doesn´t look like snapshots can be a part of a text

That is their purpose, to be set aside, impossible to edit and not visible in the binder or the “surface” text when using Scrivenings. But if you mean you would want the ability to resurrect some text into what will be a part of the Draft, then that is what the “Roll Back” button is for: it makes the snapshot part of the text again, and optionally lets you set aside whatever is currently there into its own snapshot for safe keeping.

If you want to just experiment with an alternate draft, consider selecting the group that contains the section you want to play with (like maybe Part I, or a chapter or two), and use Documents ▸ Duplicate to create a full copy of it all—this will copy the snapshots as well. You can drag that some place else, and go through, rolling back snapshots to build a different variation of the text from it. Now you have something you can read through more easily and compare to the current revision in another split.

If you end up liking it better, you can swap it into the Draft and set the other one aside, maybe filling out the index card to describe the purpose of the revision, and why you decided to go another way.

I didn’t ask if a data scientist or programmer could extract the differences between two Scrivener projects, I asked I there was a way WITHIN Scrivener to find and deal with differences between two Scrivener projects.

Scrivener users are human beings, authors, writers. Scrivener was written as an aid in the process of writing. That process would be intractable should it require a writer to program solutions in C, or to become OS command line experts.

I don’t know why other Scrivener users might need to compare whole Scrivener Projects, but for me the need is corrupted Scrivener projects, Scrivener projects that upon launch the user is prompted with warnings about corrupted files, and where the user finds that many of their project’s documents are missing or the binder has been corrupted, and or, documents have been un-named or re-named and moved in various states to folders outside the manuscript/draft folder where they were originally, to folders that Scrivener created autonomously, and where documents are straight up missing or where the text within them is corrupted.

Yes, I understand. That’s why I suggested the Import and Merge feature, which can be used for exactly that purpose.

1 Like