Linking records best practices?

What are the best practices to link records together?

Here’s a high-level overview of the developing use case and where I’m at so far:

  1. Incoming credit card statement (PDF)
  2. Smart rule -> external AppleScript -> shells to pdftotext -layout (to pretty things for regex) -> shells to perl script -> parses date, due date, amount AND parse out/creates a CSV file containing the transaction line items -> returns to AppleScript
  3. DT3 script sets due date reminder, various custom metadata, etc.
  4. Imports the CSV into DT3 naming to ... - transactions
  5. ?

Ideally the CSV would be “embedded” or “linked” to the original PDF with a clear path to get at that CSV for further processing down the road.

  • At first I thought, annotations? But that didn’t fit very well.
  • Add the CSV text as a comment? Feels wrong, but could extract the comment and parse externally for further processing fairly easily.
  • Started looking into links - but seems those features are more about hyperlinks within the content of HTML, Markdown, rich text best I could tell

Digging through forums, not easy to search forums for such generic keywords such as ‘link documents script’, etc.

Found “Group Items” in the GUI menu. Seems it might be a best practice for this situation, especially considering there will likely be further processing and more interim docs/records to further work those line items in the transactions CSV to connect the dots to other related records in DT3

Are there any examples of how to “Group Items” via script?

Sheets? Found a post in the forums from 2006 re: linking documents to records in a sheet That’s not yet possible but will come.

Open to alternative approaches, have a feeling that something is being overlooked in the pattern development here.

I have many multi-item notes
I use the Group Items feature, and work at the group level assigning name, tags, …
If it’s overly complex, I generate and edit a Table-of-Contents