Bookends attachments folder and DevonThink database
Bookends attachments folder and DevonThink database
I wonder, would it be possible to somehow keep my BE attachments folder inside the DevonThink database? Presently I keep that folder in /Documents/ and simply synchronize it in Devonthink so as to be able to search and view all attachments within DT. But whenever I wish to run a PDF attachment through the DevonThink OCR engine things get complicated because DT actually imports the document. So then I have to export the newly generated searchable PDF to the BE attachments folder, erase it in DT, and finally I must synchronize the Bookends attachments folder anew. Kind of tiresome in the long run... Any ideas, suggestions? Thanks.
-
- Posts: 21
- Joined: Mon Apr 25, 2005 9:43 pm
Re: Bookends attachments folder and DevonThink database
No idea if that is possible and I also do not have the Office version to test the scanning but you could try to automate the task using applescript. The following script is a simple demonstration and works only if you have a single attachment folder (no subfolders). It is also necessary to have the the scans in the same group in DT before you run the script. Take care that the script will delete the original file, so test with copies first!
Rudi
Rudi
Code: Select all
--set the correct path for AttachmentsFolderPath!
--it works only if you have a single Attachment folder
--it works only if the scans are in the Attachments group in DEVONthink
set AttachmentsFolderPath to "/Users/Username/Documents/BookendsAttachments"
tell application "DEVONthink Pro"
set file_list to selection
if file_list is not {} then
set myParent to parent of item 1 of file_list
set myParent to item 1 of myParent
repeat with c from 1 to count of items of file_list
set myName to filename of item c of file_list
-- if you want to keep the original file then delete the next 2 lines!
set myFile to quoted form of (AttachmentsFolderPath & "/" & myName)
do shell script "rm -f " & myFile
export record item c of file_list to AttachmentsFolderPath
delete record item c of file_list
end repeat
synchronize record myParent
end if
end tell
Re: Bookends attachments folder and DevonThink database
Thank you, thank you, thank you! Works like a charm. 

Re: Bookends attachments folder and DevonThink database
If I understand correctly, the script keeps the attachment in BE's attachment folder, and syncs it with DT. Would it be possible to tell BE that the attachment is in the DT database (a package the Finder can see)?.
Just as a wish: Imagine I'm in DT viewing a pdf document I've imported into DT. Would it be possible to write a script that tells BE to create a new record, attaches (without moving/copying it) the selected pdf in the DT database to the record and, and lets me fill in the data in the BE record? Whenever I get to the BE record I shuold be able to see the pdf in the DT database.
Just to jump into science fiction: if it could read (if there are) the DOI and (in the future) OpenMeta tags and fill in the fields that match...
Regards
Manuel
Just as a wish: Imagine I'm in DT viewing a pdf document I've imported into DT. Would it be possible to write a script that tells BE to create a new record, attaches (without moving/copying it) the selected pdf in the DT database to the record and, and lets me fill in the data in the BE record? Whenever I get to the BE record I shuold be able to see the pdf in the DT database.
Just to jump into science fiction: if it could read (if there are) the DOI and (in the future) OpenMeta tags and fill in the fields that match...
Regards
Manuel
-
- Posts: 21
- Joined: Mon Apr 25, 2005 9:43 pm
Re: Bookends attachments folder and DevonThink database
Bookends is not scriptable, DEVONthink is. So you cannot automate the creation of a new record in Bookends. Eventually future versions of Bookends will be scriptable. The chance for this will increase with the number of users asking for it. As for the location of the attachments, maybe Jon can let you know whether it is possible to specify an attachment folder inside a package and if there are any disadvantages.
Rudi
Rudi
Re: Bookends attachments folder and DevonThink database
Hi,
I think you could attach a file in a package if you opened the package and performed a drag and drop. Offhand I can't think of a reason this would be a bad thing to do (but make sure to tell Bookends not to move the file when it is attached).
Jon
Sonny Software
I think you could attach a file in a package if you opened the package and performed a drag and drop. Offhand I can't think of a reason this would be a bad thing to do (but make sure to tell Bookends not to move the file when it is attached).
Jon
Sonny Software
Re: Bookends attachments folder and DevonThink database
I'm still in the process of learning how DT's new database structure functions. If it is in one folder in the database, will it stay there forever? If so, this type of attach would be very good indeed. But if I move that pdf in the database, will it move folders in the actual package? You'd also have to be sure to never rename your database.
An option is to keep all your pdf's in DT, and just use local DT URL's in BE to link to the pdf.
An option is to keep all your pdf's in DT, and just use local DT URL's in BE to link to the pdf.
~I swore to myself that if I ever got to walk around the room as manager people would laugh as they saw me coming and applaud as I walked away~