I’m trying to troubleshoot a puzzling issue with devonthink indexing tagged PDF files. I index a large batch of PDF files which have been named and organised using BibDesk. These files are saved to a common location in a Dropbox share (this is the standard bibdesk routine) but come from a variety of different bibtex bibliography files managed by this application which contain a range of data about each citation and which is associated with a specific PDF. I use an applescript to save keywords which have been assigned to these books / articles etc. to the PDF files as macos metadata (“BibDesk-MavericksTags” at github.com/derickfay/BibDesk-MavericksTags.git). The script runs the following line to encode tags:
do shell script "xattr -w com.apple.metadata:_kMDItemUserTags '" & plistTagString
When I open files in macos finder tags show up in the listing. However, when I index or import files into devonthink, no tags appear. I have found a fix for the issue, which is to open each PDF with a get info dialogue in the finder, and then add a new (unique) tag. Once I update in devonthink, it immediately recognises the new tags. I also noticed, strangely, that when I add a tag in devonthink, it gets placed in a slightly different container:
jkidwell$ diff wolfe_before.txt wolfe_after.txt
37a38,41
> kMDItemOMUserTags = (
> "animal_studies"
> )
> kMDItemOMUserTagTime = 2016-01-30 21:58:33 +0000
44d47
< "animal_studies",
47a51,53
> kOMUserTags = (
> "animal_studies"
> )
(in above, I deleted the tag in devonthink and then added it back)
At first, I thought that the BibDesk-MavericksTags application might have been embedding tags in a strange way (as above), but mdls for before and after my get info finder fix shows that absolutely nothing has changed in metadata from before / after tagging (except for the addition of a new tag):
Before:
After:
jkidwell$ diff rabinow_before.txt rabinow_after2.txt
49c49,50
< ethnography
---
> ethnography,
> ethnography2
This leaves me believing that perhaps there is a database in macos that needs to be rebuild in order for these tags to function in devonthink. I’d be very happy for any suggestions here, particularly if I should modify the bibdesk script slightly to store tag metadata in a different field?
Oh and, yes, I’ve left a very long time (a week) after adding tags to make sure macos finishes reading them, and have also unchecked “exclude groups from tagging”
Thanks for the help!