Master Note as dynamic overview of my groups and documents together with labels

Good morning everybody,

I tried to search carefully whether my issue is already in the forum but couldn’t find anything - let me apologise in advance if I missed something!

My question:

Is there a way to create a “Master Note” as an overview or perhaps entry page to a group or Data Base like a Table of contents with links and the attached labels? There is a script unter “scripts - new - markdown see-also” which comes quite close but the information given there is unstructured and overwhelming so it wouldn’t be of practical use for every day’s needs.

Thank you all in advance so much for any assistance!

It’s unclear what exactly this master note should contain (a Markdown example or a screenshot would be useful) but did you have a look at Tools > Create Table of Contents?

I use an Applescript to generate my customized “Master Notes”; structured Table of Contents

For example, my master note for projects has the following sections

Project

Notes

Receipts

Tasks - Active

Tasks - Next Action

Tasks - Waiting

Tasks - Pending

Tasks - Completed

1 Like

Thanks a lot to you all for so very immedate answers!

I attach a screenshot of my colleagues “Master Note” in Notion. I don’t want to switch to an online database, but this special feature would be great to have.

I also attach a screenshot from my DT, where you can see that Create table of contents (German: Inhaltsverzeichnis) in my case isn’t active.

Many regards and thanks again!

Also to you - thanks a lot for assistance!

This screenshot is hardly legible. Perhaps you can replaced it with something that’s scaled down?

1 Like

Yes, sorry, you are right. The screen is too broad - here come two split versions.

So, you want a table containing names and some metadata of all documents and subgroups in a selected group? What about documents in the subgroups?

Yes - the documents and their labels are the important information - like to know whats up at one glance and be able to access the targets from there.

A very basic script could look like this (that is JavaScript, not AppleScript!)

const properties = ['name', 'creationDate', 'modificationDate', 'label', 'tags'];

(() => {
  const app = Application("DEVONthink");
  const group = app.selectedRecords()[0];
  if (!group || group.recordType() !== 'group') {
    throw('Please select a group first');
  }
  if (group.children.length === 0) {
    throw(`Selected group "${group.name()}" is empty.`)
  }
  const dataTable = [];
  group.children().forEach(c => {
    const rowData = properties.map(p => c[p]());
    dataTable.push(rowData);
  })
  const mdTable = properties.join(' | ') 
   + '\n' + '|--'.repeat(properties.length) 
   + '\n' + dataTable.map(row => row.join(' | ') + '\n')
   + '\n';
  const masterNote = app.createRecordWith({name: `MasterNote for "${group.name()}"`,
    'record type': 'markdown'}, {in: group.locationGroup });
  masterNote.plainText = '# MasterNode for group ' + group.name() + '\n' + mdTable;
})()

It creates a new Markdown record in the parent group of the selected group:

# MasterNode for group images
name | creationDate | modificationDate | label | tags
|--|--|--|--|--
img-half-width | Fri Jun 10 2022 14:23:43 GMT+0200 (Mitteleuropäische Sommerzeit) | Sat Jun 18 2022 11:07:06 GMT+0200 (Mitteleuropäische Sommerzeit) | 0 | 
,Blockquote-1 | Fri Jun 10 2022 14:23:43 GMT+0200 (Mitteleuropäische Sommerzeit) | Sat Jun 18 2022 11:07:06 GMT+0200 (Mitteleuropäische Sommerzeit) | 0 | 
,Blockquote-2 | Fri Jun 10 2022 14:23:43 GMT+0200 (Mitteleuropäische Sommerzeit) | Sat Jun 18 2022 11:07:06 GMT+0200 (Mitteleuropäische Sommerzeit) | 0 | 

If there are tags, they are listed as comma-separated values after the label. The date formatting is just the default JavaScript variant, it would have to be modified to be useful.
The properties to be put into the table are stored at the top of the code in the array properties. If you need user-defined metadata as well, you’d have to handle that differently.
I did only basic testing with a group containing only documents, i.e. no other groups. This case would perhaps need special handling.

3 Likes

I don’t know what to say - thank you so much!

:bouquet:

2 Likes