Automated way to create note titles from note text body?

Dear Dr. Mark Anderson,
Thanks a lot.
I got it. It works !!
Yours cordially, WAKAMATSU

Dear Dr. Mark Anderson,
Might I ask you some questions?
I set Stamps [$Name=$Name + Text.words(5)],
but when I wrote blank column in my text.
Why blank column cut up worth as quotable phrase?
I would like to know what mean words(5) ?
Is not it the total number of words?
Yours cordially, WAKAMATSU
P.S
This is my sample which I have tested.
original Note.png
Original-newNote

– From here
2021年07月01日

This is NewNoteName.
—End phrase.
(As a resultt png. in Outline view.)
StampedNewNote

Dear Dr. Mark Anderson,
Might I ask you some questions?
[$Name=$Name + Text.words(5)],
word(5) means, a phrase of which,
Number of words separated by whitespace.
blank column count only or same as the one space.
Is it correct to understand it this way?
Yours cordially, WAKAMATSU

As much as I know is described here: String.words(N).

BY the way, do you use the Google Translation on aTbRef pages. It is at the bottom of each page:

If I select ‘Japanese’ from the pop-up the page on String.words() looks like this:

The translation is by machine (Google Translate), but I wonder does the translation feature help you at all?

I’m not sure what you mean by ‘blank column’. Perhaps the Tab (⇥) character? (Tab key - Wikipedia)

Dear Dr. Mark Anderson,
Thank you for your instruction.
I am delighted to receive your kind thoughtfulness.
As for the things you taught me, I think I have understood and digested them all.
As for the blank lines (‘blank column’ or 1 line opening ?),
unfortunately I do not know the correct way to describe them.
I apologize if I caused any misunderstanding.
In Japanese, I am afraid it is difficult to eliminate ambiguity over
association with single word.
“Romans, they go house?”. = 「ローマ人、彼らは家に帰る?」
We do not use a space between words, as you see here.
[ returns “Romans, they”. ] =[「ローマ人、彼ら」 ], we can not have discriminant with this EG.
I regret to say translation feature can not help me at all.
The Japanese language. It values the flow that continues uninterrupted.
In this sense, it is the same as the etymology of TIME, which comes from the Teutonic language.
There are no breaks in the context as much as possible. It has such a characteristic.
Please be carried away with indeterminacy of translation in Japanese.
Improve my competence in the foreign language, cup of tea for me.
Learning unfamiliar languages is a hobby for me.
In order to master the language of music, I have learned various foreign languages. English, of course, but also French, German, Dutch, Latin, Greek, and Sanskrit, which is the original language of these languages.
This Tinderbox is one of my “foreign language” studies, and I am working very hard on it.
I use “LaTeX” for my daily writing. ( Emacs or Spacemacs )
I am proficient in 90 percent of the various applications available for writing, including LaTeX.
The one application for writing that I have not been able to overcome is Tinderbox.
The last remaining stage is Tinderbox.
I am looking forward to the day when I can conquer it, and I’m working on my learning every day.
Last but not least, I would like to ask for your continued guidance and support.
Cordially yours, WAKAMATSU

1 Like

Wakamatsu, I only mention this because you say you like learning languages — your English is vastly better than my Japanese…

The term you’re looking for is simply ‘blank line’.

‘Column’ in English almost always refers to a vertical line (e.g. a column which holds up a Greek temple, or the vertical line of entries which run up or down in a table or spreadsheet). I think this is why there was a little bit of confusion in your first post, as there were no real columns in your description.

A horizontal line is usually a ‘row’. In your case, though, while we say ‘a blank row in a table’, we don’t normally refer to a ‘blank row’ of text (though it’s understandable), but simply to a ‘blank line’. Conversely, talking about a ‘blank line’ in a table or spreadsheet would usually be called a 'blank row. English is illogical…

Hope you don’t mind me mentioning this. I also like learning languages, but you’re far ahead of me in the range I’ve attempted…

Best wishes,

David.

1 Like

Dear David Bertenshaw,
Thanks a lot for your kindly words of advice.
I think these were the better explanations needed.
Blank string (or blank box article, If such an expression is possible.)
Regular expression : blank line
(Maybe I should use “null line” or empty string ?)
I was allowed to study again this time.
Optime valete, WAKAMATSU

Here, blank line is correct, because we’re talking about a line in a body of text. But this is as much to do with technical reasons as vocabulary…

‘Null line’ isn’t really used. ‘Empty string’ means something different — e.g. if there was nothing in the $Text attribute ($Text=""), then that’s an empty string, but here we’re talking about a line in the text with no characters.

Behind the scenes, a blank line in the text is just two ‘line-feed’ characters together. So the text:

This is line one

This is line three

would be represented by $Text="This is line one\n\nThis is line three", with the second, blank, line shown by \n\n. That means that if you want to search a value for a blank line, you would search for two consecutive \n characters.

For example, you could change the text in this note

to this

by using the stamp

$Text=$Text.replace("\n+","\n")

…which translates to ‘remove every blank line in the the text’ by searching for two or more consecutive line feeds (\n+) and replacing them with a single line-feed (\n).

So, to sum up, here you’re probably wanting ‘blank line’, rather than ‘empty string’.

Hope that makes sense!

Best wishes,

David.

Dear David Bertenshaw,
Thanks a lot for your clarifications.
I have been re-learning “regular expressions” for a while,
so I can understand your explanation this time.
In the example of the first question (July 01, 2021),
I wanted to make the command “write only the first line”,
so I dare to execute “line feed”.
From now on, I will try using stamp that removes “blank line”.
Respectfully, WAKAMATSU

Glad it helped!

Dear all,
Just to let you know.
Version 4 of the BBEdit.app adds a new feature that
will automatically write the first line of the note
you want to create as the name of the document.

If you write “today’s date” and “special note” in the first line,
you can use it as the basis for filing a zettelkasten.
This BBEdit 14.0 may take on a new role for the notes I used
to make using nvALT (ver. 2.2.8) and Zettelkasten3 (ver. 3.3.0).
thx and regards, WAKAMATSU

Thanks for sharing. BTW, in Tinderbox you can do something quite similar. I user TBX for project tracking and make update notes. Here is an OnAdd I’ve put on my Person prototype (use something similar for tasks).

$Prototype="pUpdate"; $Name="UD- "+$Name(parent)+" - "+$DateToday("TBXConfig").format("l");
Note how I’m have the OnAdd create the update name and add the date from my configuration note. As I’ve stated in the past, I have the configuration note calculate value for me, this improves performance for my files.

Dear satikusala,
Thank you for your concern.
I would like to thank BBEdit for the information they have provided,
as it has solved a problem I had before.

I am currently using Stamp
“Today+NewTitle”
$Name = $Created.format(YM0Dhmm)+" - " + $Text.words(1);
in Tinderbox9 to change the title freely.
Sometimes I change the number in words( ).

In other cases I use the following stamp
NewNoteTitle :
$Name = $Name +" - " + $Text.words(1);
Respectfully, WAKAMATSU

P.S.
I will also try the way you describe your specification.

If looking at BBEdit Text Factories, see my illustrated walkthrough on in the thread Fixing a semicolon-delimited file for CSV import (worked demo with files). Since writing that and doing a close read of the BBEdit v14 PDF manual is it clear that Chapter is out of date (likely not updated since v13) and has proofing errors. I’ve passed them on to Barebones who I hope will update the manual. Currently for a new user of Text factories it is misleading and incorrect in parts—not good for learning!

Dear Dr.Mark Anderson,
Thank you for pointing out that
since the User Manual has not been updated,
we should carefully examine the contents and read it.
I just installed BBEdit14.0 yesterday
Fortunately, I have not read this PDF Manual.
I will read it carefully.
NisusWriterPro has been using this kind of handling method,
which is the title of the first line when saving, for a long time.
The same function has been added to BBEdit14.
It was a long time ago, but NisusWriter Pro and Merrell were
the few apps that I love to use when converting files from LatTeX.
There is no other alternative app, so I have no choice but to purchase and use it.
It has reached the present. (Although this was also around the time
when the LaTeX function was available in the original Ulysses)
Recently I am struggling to master Tinderbox 9.
Respectfully, WAKAMATSU Kunimitsu

1 Like

Just wondering if this ever happen…

Mr. J. C. Martin paid for the ticket.

Sure. I think the original issue involved exploding notes and using the first sentence as the title. Sentences beginning with the names of physicians were all named “Dr.”

Bonus points to anyone who, without reference to Google, knows who J. C. Martin is.

Ah. I though it might be possible to do this with a stamp code instead of through the explored process. No chance there’s a stamp code option?

Thanks!

Oh, sure. I simply thought this was a nice alternative.

With a stamp, you don’t need to worry about gathering notes. Stamps act on the notes you select, so you do that part!

The action in the stamp would be the same action in the agent would do.

I’m absolutely happy to consider other ways to use the code. For background, I’m trying to extract a few words from the top of a note’s text (in the body) in order to create note titles, and then move the notes’ text (which appears as the titles) into the notes’ text body, as I mentioned at the top of this post.

Through that process, would I first set up an agent to capture newly imported notes, and then action code to generate the title change that you’re referring to?

Thanks!