Accessing/Writing to the custom metadata fields outside of DT

I am trying to create a workflow for use with my database of indexed files that finds a certain string in the contents of the file and then writes the value (if one is found) to a custom metadata field that i’ve setup in DT preferences.

I tried using mdls filename.pdf at the command line to see whether the custom metadata is written to the file that way, but it doesn’t appear to be… Is there a similar command where I can see (and write) to the custom fields?

To be clear, I know that I can write to the custom metadata field within DT using a smart rule, but this doesn’t seem to be a solution since I don’t seem to be able to search the contents of a document, capture a value, and write that value to the custom metadata field using smart rules. please correct me if I’m misunderstanding the smart-rule functionality.

cheers!

Does this work:

image

You won’t get a value from an mdls command as the custom metadata is internal to DEVONthink. And no, you can’t write to custom metadata outside DEVONthink.

Custom metadata can be scripted, maybe this could be useful?