Automatically name the destination file's name (for Transporter or Note Composer...)?

While I’m reading, I want to create events for my timeline, right in the main document. For example:

NEW SECTIONAL ALIGNMENTS
The first uniform school system in Mississippi was established in 1870 under Radical Republican rule. [1] Each county and each city of five thousand population was made a school district, and free schools were to be maintained for a period of four months each year.

And I want to write below that:

start-date::1870
label:: "The first uniform school system in Mississippi was established in 1870..."

start-date::1873
label:: "The second school district...."

and then have my “timeline” query treat teach of those start-dates as two separate items, instead of an array of start-date and an array of labels, with no connection between 1870-first and 1873-second.

The only way I could “group” them is to turn each one into a new Note. I’d prefer to wrap something around them, instead of tons of new notes, but so be it.

So I’m trying Transporter and Note Composer. But they are slow for my quick reading and entering. Transporter seems to want an existing note. Note Composer wants a real name, and generates “Untitled 2” etc, for each new note it creates, which requires typing from me to type a real name, when I don’t care what the name is. What would speed things up is to pre-name any new Notes with a unique identifier, like a timestamp. YYYY-MM-DD-hh-ss-PartOfTheLabel.md for example.

I can’t figure out how to do that, in either Transporter or Note Composer. Is that possible?

Other ideas for my primary goal – grouping meta-data clumps into legit items? There are some advantages to separate Notes per meta-data clump, but there’s also overhead to it…

I wouldn’t mind writing some kind of simple script or plugin, to handle this kind of notation:

```timeline
start-date::1873
label:: “The second school district…”
```

Is that easier than I think?

Thanks!

1 Like

As you most likely have discovered that kind of fields are connected to the page scope, and not to the paragraph. To connect these fields you need to change scope into item scope, so that it would be seen as:

- [start-date:: 1870] [label:: The first uniform.... ]
... some other text ...
- [start-date:: 1873] [label: The second school district ... ]

Now you can access these separately and get one entry for 1870 and for one for 1873.

To make conations like these fast I would suggest building a template which you trigger by a hotkey after selecting the text. Then you could also add some cursor positions within that template to first place you near the start to insert the year, and then hit the hotkey for next cursor position to get after the notation. (This requires the Templater plugin)

Thanks holroy! I indeed just wrote something, so I could get it really customized.

Here’s what I came up with:

I appended “_timeline_item” to a long version of the date, to get a unique filename with a little extra information to help later if I do another query based on filename.

I also added a link (aliased to “TL” so it’s not visually bulky) to what I’m calling the Source Note, and re-formatting the selected text to be a code block, so I can tell whether or not it’s been turned into a Note.

start-date:: 1907
label:: The gubernatorial election in 1907 was overshadowed by the senatorial race.

<%*

let my_content = tp.file.selection();
let my_source_note = tp.file.title; 

if (my_content) {
	newfilename =  tp.date.now("YYYYMMDD-hhmmss") + "_timeline_item"; 
	tp.file.create_new(my_content + "\n" + "source-note:: [[" + my_source_note + "]]", newfilename, false, app.vault.getAbstractFileByPath("Delta-Mississippi/timeline_items") );
	tR = "```\n" + tp.file.selection() +  "\n```" +  " \n" + "[[" + newfilename + "|TL]]"
}
%>

If there were a way to map a hotkey to my apply-my-own-Templater-script, this process would require only one keystroke-set, instead of one+some_typing.

Goto Settings > Templater > Template Hotkeys, and select your template. Then hit the plus icon, and set a hotkey in the next window.

Whee! Works perfectly. Thanks so much! Now I can get through my notes much faster. :smiley:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.