Changing path of indexed files (aka fixing broken links)

Hi,

I’d indexed a bunch of MacTeX documentation files in my DTPO database. The actual files used to reside at the following path:


/usr/local/texlive/2011/texmf-dist/doc/…

Yesterday I updated from MacTeX 2011 to MacTeX 2012, and subsequently uninstalled the old version. That second step was foolish, because now the documentation files no longer reside in the aforementioned path but rather in:


/usr/local/texlive/2012/texmf-dist/doc/…

As a result the links from DTPO to the actual files in the filesystem are broken.

Is there a quick way to replace 2011 with 2012 in the paths of those files without having to do it manually for each one? We are talking about ca. 100 files here!

Thank you.

Is it possible to index the new folder at the …/2012/… address?

If not, then it might be easier to change things in the file system than in DEVONthink. The reason is that the path property of a DEVONthink record (file or document) is read-only. It cannot be changed. So any script would be a work around. I.e., search the database for records with properties containing the old path, save the records in a list, parse the list and indicate (the verb for creating an indexed record) new records with the new path side-by-side with the old record. After validating the new records, a second script could find and trash the old records.

Rather than a script, just create a folder in the file system with the old …/2011/…folder name and copy (don’t move) everything in the …/2012/… folder. As long as you haven’t changed anything in DEVONthink (i.e., you didn’t move the “missing” records to the trash, and empty the trash), this will instantly fix the problem. Put a readme file explaining what you did and when you did it into those two folders and in your database – so a year from now you can be reminded if the occasion arises to update to 2013 :confused:

A fine idea, thanks. I could try to take it a step further and symlink the 2012 folder into a new 2011 folder.

DEVONthink won’t index an alias or sym link.