I was wondering – is there a way for me to ‘pull’ the content of a metadata field into its document, merge-style?
As an example:
I have a database of RTF documents for some 9000 individuals from 1800s Massachusetts. In the image below, you can see the one for James Hyden Babcock.
In the RTF document, I typed in his lifespan manually ( - ), and then also entered each into custom fields (this makes it sortable, see columns). Is there a way to build things so that field , for example, is mirrored into the RTF from the metadata field, rather than relying on duplicate entry?
(Yes, it is important to have it in the document itself, so that it is printable with all relevant data in the layout.)
Notice there’s a tab in the Content field, so it more closely matches these types of documents.
My custom metadata for Born and Died are the data type Single-Line Text.
This will run on demand or optionally after you save the document. So if you’re entering a new one and save the document, the metadata will be updated.
It also accommodates some variation, so if you switched to an em dash or forgot the spaces, it should still work.
I think your regex might not work the way you want it to. [ -–] stands for “a character from space to endash”. What you probably want is [- –], ie “either dash or space or endash”
Background: to have a literal dash included in a character class, it must be the first character, directly following three opening bracket.
Either way, it’s working perfectly as is. As in these two glorious, generated columns. Next up, stretching my wings to see if I can adapt this to work the same magic with the ID field and corresponding document text.
Very nice and glad to see it worked well for you! And not even any scripting involved! (Though there is a little regular expression black magic, I’ll admit - haha!)
Indeed! And while I don’t advocate After Saving for some heavy lifting operations, this is a minor Scan Text and updating a few metadata fields. That should have no appreciable impact as a document is edited. It also covers the case where it would catch a later edit to the birth or death years in this case.
I need to learn these Scan Text and Regex things
Regex is a dark art but powerful! There are many online resources to familiarize yourself with.
I have used this site many times over the years for messing about with RegEx…
Lifespan followed by any number of colons (including none), followed by any number of 4 digits (including none), followed by exactly four digits.
I’d go for Lifespan:\s*(\d{4})\s*[-–]\s*(\d{4})
That makes whitespace possible but not required and dash/endash required, exactly one of them once.
As long as the documents are formatted correctly, your original approach works, of course. I’m just paranoid.
@waystone, I enjoyed reviewing the structure of your person-document. Apart from the immediate issue in this thread, I, and probably other researchers, would enjoy learning more about your research process using DEVONthink. (And other software.) If you could someday make a posting about your process, it would be interesting to read.
I’m also interested, but imho Devonthink is not a great tool to store/organize/present this data
I don’t want my custom metadata cluttered with born/died
(And other software.)
I use MacFamilyTree apps (Mac/IOS) and their website
I’m more a fan of Reunion when it comes to genealogy-centered apps for Mac, @DTLow – and use it extensively for my own genealogy purposes – but this research is different, and is a poor fit for those kinds of tools.
Devonthink, on the other hand, has the flexibility I need to get the job done.
My research isn’t lineage-based. I study the experience of disability (and more specifically, intellectual disability) in New England in the 1800s. Doing that takes a system that allows one to explore all kinds of facets and connections, with family-based ones being the least important of the bunch.
I do keep some basics in GEDCOM form, but it’s really just as an extra-extra backup. It’s not very useful to me otherwise.
I’ll post more soon. Any chance to talk about one’s scholarship is a good one! Anyone who’s curious about the topic in the meantime, though, can find me over at https://naomischoenfeld.substack.com/ .