Automatically append attribute values to existing text of notes

This is possible, if you specify a section within the Text where you would like the attribute values to go. I agree with @mwra’s general assessment about the best way to accomplish what you’re aiming for. But independently of that, this is a useful trick for generating reports in a note’s text.

The attached document contains a prototype with the following Edict:

$InboundLinks=links.inbound..$Name;
$OutboundLinks=links.outbound..$Name;

if ($Text.contains("(.*BEGIN_LINK_REPORT\n).*(\nEND_LINK_REPORT.*)")) {
$Text=$1 + 
      "InboundLinks: " + $InboundLinks +
      "\nOutboundLinks: " + $OutboundLinks + 
      $2;
}

When the edict is run, it updates InboundLinks and OutboundLinks. It then checks to see if the note’s text contains a section that looks like this:

BEGIN_LINK_REPORT
...
[any text can go here]
...
END_LINK_REPORT

If it does, it inserts a report of the incoming and outgoing links between BEGIN_LINK_REPORT and END_LINK_REPORT. The other text in the note is unaffected.

Changes to the links are automatically propagated into the text of the note.

Here’s what it looks like in action:

link-report.tbx (94.2 KB)