How do I fix broken Document References

I run Scrivnener and Devonthink on a Mac using Lino 10.7.3.

I’ve run into a problem where I need to migrate my Devonthink Pro library to a shared drive from its current location on my local HD “Documents” folder.

I am well aware that doing this will break my links to all of my Document References that I have currently listed as part of my Scrivener project.

Is there a way to modify the contnent associated with the .scrivx file which I understand uses XML to hold the Document References paths?

How have you created your DEVONthink Pro links? Did you use the “Copy item link” from within DTP to generate a link in the form: [size=85]“x-devonthink-item://0CF4EBF6-AA4E-44F5-8553-3981E8BE24B9[/size]”? If you did, then I don’t see how editing Scrivener’s internal files will help you with re-mapping your references, because there is nothing really there to edit. DTP generates a unique ID to identify the document being linked, and there is no pathname or anything to indicate where it is stored. In fact, Scrivener has no knowledge of where DTP is keeping the linked item.

If, on the other hand, you simply copied the reference out of DTP, you will have something in the format: “[size=85]file://localhost/Users/Me/MyStuff/MyDTP.dtBase2/Files.noindex/rtf/0/Test.rtf[/size]”. This looks as though you can edit it to remap the link – but unfortunately, it is not a stable link in the first place. Ioa/AmberV tells me (so it must be true! :smiley: ) that DTP moves documents around internally as part of its housekeeping and optimisation, so the numeric folder name is not fixed and will change as your database evolves. As a result, links using this technique may break over time. Even if you never move your DTP database, you may find in a few months that the links no longer work, simply because of DTP’s internal management activity. The only stable link is the first variety, created by “Copy item link”.

I can’t speak for the general case, but when I recently moved a DTP database to a Public folder for sharing between user accounts on my machine, I checked the corresponding links of this type in a Scrivener project, and they have actually remained intact – at least, they still call up the correct documents, even though the DTP database has moved to a different location. The new location was, admittedly, in the same user account on my machine, which might make a difference. And I did open the database in DTP immediately after the move and before trying the Scrivener references, so DTP knew where to find it. And perhaps I was just lucky because it is a very simple database full of rtf snippets with no indexing or anything fancy. And I didn’t have many links to check. I can’t find any detailed description in the DTP documentation/forum, so I don’t know if this was happy fluke or deliberate design.

What I can say, though, is that if you want enduring links you need to use the “x-devonthink-item://” format, and that Scrivener has no control over where these point.


Hi, I have used the format: "file://localhost/Users. . . . as I did not know about the “copy item link” option when I walked through my document assigning references to my outline.

I did try to link to DTP using the “copy item link” and the downside here is that the document which is referenced cannot be opened within Scrivener using the “Open in Other Editor” option. It throws you directly back into DTP to view the document or you can open using “reveal in finder”, both options prevent me from using the built in/native function of Scrivener.

I understand that DTP manipulates the directory structure as it handles a document, but so far I have not experienced any broken links due to this situation.

Hence the reason I wanted to understand the ability to change the “file://localhost/Users. . . .” references in the .scrivx file to facilitate the movement of my DTP data.