Adding URL metadata to files - Meta Woes

Perhaps I didn’t do a good job of explaining myself above. I am not disputing whether DEVONthink is capturing the URL. As indicated above, I understand that it’s recorded in the kMDItemURL field of the DT3 file associated with the formatted note. The question was whether someone has a script to embed that URL in the formatted note, too (or another related field, like the kMDItemWhereFroms field)?


To illustrate the problem, I have clipped your post from this page as a formatted note. Then, I moved the formatted note to an external/indexed folder/group called “Articles” (Database: Research, Group: Articles). In the screenshot below, you will find an image of the note, including its inspector pane.

Next, you will find a screenshot of the metadata that’s accessible through Finder’s file information window of the formatted note - which does not contain the URL.

If you’d like to see a more detailed rundown of the metadata associated with the formatted note, please see the PDF below.

Metadata from Formatted Note.pdf (20.1 KB)


Based on this setup, since the URL is not embedded in any of the formatted note’s metadata, when I search for formatted notes using Spotlight metadata, I can’t find the note unless I use DEVONthink.

For example, if I use Alfred to search for the formatted note based on all available metadata fields - such as kMDItemWhereFroms, kMDItemURL, and every other field where you might possibly store this info - and I use the search terms “devontechnologies.com”, I can’t find the formatted note that I’m looking for.

I’d like to see the URL embedded directly into the formatted note. Doing so ensures I can use other search tools to find what I’m looking for outside of DEVONthink. It also helps guard against potential issues that might occur if I make a mistake and errantly severe the tie between the formatted note and its metadata in DEVONthink. And, if I share the formatted note, now others can actually see the URL in the file’s metadata, too.

Given how little I understand about DEVONthink, I’m sure there are use cases where it doesn’t make sense to embed the URL in a formatted note. In this particular scenario, however, where the formatted note is being created from a web clipping and the user has appropriately moved it to an external folder/group that’s indexed, it’s hard to imagine why users wouldn’t want to embed the URL in the formatted note.

As an aside, I threw out the xattr command in my initial post because I have used it in the past - through Terminal - to write a URL into the kMDItemWhereFroms field of a PDF (long before I started using DEVONthink). So, I assumed that it could be used in a shell script via DEVONthink to write the URL field in DEVONthink to the formatted note itself (or whatever format people use). But I’m pretty terrible with shell commands, and was having a tough time understanding how I could get the appropriate url and file path to even run it. In any event, I’m up for any type of solution. Has anyone tackled this - or a related metadata issue - using xattr or another tool in DEVONthink?

Thanks for your help!

1 Like