The standard usage of Bookends + DTPO seems to be to index the Bookends Attachments folder in DEVONthink. But I really, really, really do not like indexing important information – if I replicate an indexed item and then later change the file name, the replicant just disappears. No bueno.
So I want to keep my PDFs in DEVONthink, drag them into Bookends, and have Bookends get all the nice metadata. It should link back to DEVONthink somehow for the original PDF.
Is that possible? I found this post from someone hoping to do the same thing, but there was no resolution on it.
Please do not tell me to index the attachments folder I know how to do that, and I don’t want to.
It certainly worked at the time - but haven’t used it as much as I initially suspected, given that it served to overwrite any automatic links created when using the “Annotation” note feature in DTPO, the latter which I use extensively.
Regardless, the above might give you some ideas? Best of luck - shout if you find something!
Here’s a simple script that imports PDFs from Bookends to DEVONthink:
-- This script relies on a custom format called "Attachment Path"
-- which is defined simply as: m
-- handle errors
-- handle existing records in DEVONthink
-- delete original PDF?
-- change this to the Bookends user field you'd like to use for DEVONthink URLS:
set bookendsDTURLfield to "user1"
tell application "Bookends"
set theIds to paragraphs of («event ToySRUID» "Selection")
repeat with theId in theIds
tell application "Bookends"
set thePath to «event ToySGUID» theId given string:"Attachment Path"
set thePath to do shell script "echo " & quoted form of thePath & "| /usr/bin/ruby -r cgi -e \"print CGI.unescape(STDIN.read).gsub('file://', '')\""
tell application id "DNtp"
set theDocument to import thePath
set URL of theDocument to "bookends://sonnysoftware.com/" & theId
set theDTURL to reference URL of theDocument
tell application "Bookends"
«event ToySSFLD» theId given «class FLDN»:my bookendsDTURLfield, string:theDTURL
I think at best it would consider it an orphaned file (although in which DB, I have no way of knowing).
This is precisely why I don’t want Bookends maintaining attachment references to the files. Once they go in DT, there’s no way of knowing where they’ll be on disk. That’s fine with me, I just don’t want Bookends saying the attachment has gone missing. That’s extra cognitive load for me.
btw the truly ideal scenario would be for DEVONthink to have some mechanism for locating missing files by way of file id on disk. That’s a feature provided by OS X that other apps (e.g. AudioFinder) use. You can move a file on disk, rename it, whatever you want, and AudioFinder can update its location no problem.
DEVONthink’s indexing is based on a hard-coded location. It could be way more useful if it took advantage of OS X’s file id mechanism.
I don’t understand what this script does. Doe it import the PDF to Devonthink’s database?
I see that the format gives the path to the file. But, if you import the PDF to Devonthink, won’t BE lose the attachment?
/a little experiment: I can import the pdf to Devonthink first; then attach it to BE reference. I can tell BE not to move it. It all works very fine. The problem would be; if I rename the file from BE, Devonthink misses it. Devonthink doesn’t tolerate any change within its database folder. BE has no problem if you move the attachment around so far as you don’t rename it. It can even find the attachment in the trash. BE is very interesting. If renaming can be avoided, it is possible to first put the PDF in Devonthink and then attach it to BE. it works fine. /
Yes it imports it. Then it sets the imported PDF’s URL to the bookends URL so you can one-click to the bookends reference. It also sets a custom field in the bookends so you can easily get to the DEVONthink PDF.
No bookends won’t lose the attachment, because importing copies the file instead of moving it.
But personally I want to delete the original file, because I don’t want bookends to have an attachment. I’ve talked about this before already.
Bookends now has a wonderful ios app. If you delete the original, you cannot use the bookends ios app for reading the pdf files.
Is the ios app of Devonthink good for reading pdf?
I think I will follow the traditional approach–keep my pdf files in Bookends. I don’t want Bookends to lose the attachment; nor the duplication of the files. If there is a way to point for both apps to use the same folder (resource), it would have been great. I have tried Sente and Bookends before. They shared a folder with no problem.
But, we cannot push the developers at Devonthink as they have already offered the index option.
I actually am now convinced that putting Devonthink’s index (Files.noindex->pdf) as the default attachment folder for BE is very possible. But, the process has to follow certain strict steps. It also requires that you have only one BE library. Multiple libraries would make it hard to point the default folder structure towards the Devonthink database/there is still a possibility to use symbolic links for multiple sub-folders of BE library; but I didn’t look at it/.
Here are the steps if sb wants to try out:
For already existing references:
first, index the default folder of BE into Devonthink.
in Devonthink, move into database
change the default attachment folder in BE to Files.noindex->pdf
For new references
First, make the Files.noindex->pdf as default attachment folder in BE
Fill up your reference information–>Attache the PDF to BE reference without moving the PDF into the default folder (still keeping the PDF in your downloads folder, for instance). You have to say NO when BE asks you to move the attachment. This is the most important part of the steps. Otherwise, the Pdf will be an orphan in Devonthink.
Rename the reference in BE (if you have to rename it: this is the time)
Import the PDF to Devonthink.
Bookends has some magic. it will automatically find the PDF so far as Devonthink doesn’t rename it; and, that they are in the sub-folders of the default attachment folder.