Tinderbox Forum

Automated way to create note titles from note text body?

Is there a way to automatically extract a few words from the top of a note’s text (in the body) to create note titles? Ideally, I’m seeking to do this in a batch function, i.e., for bunch of imported notes that lack titles.

Thank you.

If you want 3 words:

$Name=$Text.words(3)

This might be a stamp, or perhaps an agent action.

5 Likes

WOHA !!!

Thanks for this . I was about to ask the same question.

2 Likes

Coming in Tinderbox 9: Tinderbox will have smart functions to extract the first sentence of a string, even in the presence of confusing punctuation like

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

2 Likes

maybe we can see this demo on one of the meet-ups !

Thank you so much for this! It’s incredibly helpful. I might switch the number of word to five or so. And yes, upcoming features like “smart functions to extract the first sentence of a string” sound amazing! Cannot wait…

Thank you again. This is great…

1 Like

This is a slightly different question than the one I started with at the top of my query, but is in a similar vein… (Happy to post this in a separate post if that’s advisable).

Normally, I import notes with or without titles – which is why I originally asked about an automated way to create note titles from note text body.

But I’ve recently been importing notes that haven’t been separating the note title from text body, so everything just appears as one big text blob.

So, I’m wondering… Is there a way to do the following for a batch of notes:

  1. Create a stamp that would include your suggested command $Name=$Text.words(3) to create the notes’ titles, and then

  2. …move the notes’ text (currently appearing as the titles) into the notes’ text body.

Please let me know if I can further clarify what I’m seeking if I’m not completely clear. Thank you again for your help!

I’d do it in the other order. First:

$Text=$Name;

This copies the current name to the text. Then:

$Name=$Text.words(3)
1 Like

Great. Thank you!

It works beautifully… One tiny thing: after applying a stamp, the title still occupies a mass of space where the text used to be. Any way of removing that?

I’m excited to use this in Tinderbox 9, and its smart functions to extract the first sentence of a string! Seems like that would create even better titles…

Thanks so much again!

In outline view, you might need to click on the active tab, asking Tinderbox to lay out the outline afresh. That’s an expensive operation, so we don’t want to require it for every action.

2 Likes

Thank you so much. This is great; works perfectly… Really appreciate your help w/ this.

Well, since Tbx 9 is out, I’m wondering how it’s possible to do this!

I can’t find a sentence detector function. The above may be a reference to the new String.paragraphList operator. But a paragraph may have more than one sentence.

1 Like

It’s automatic in Explode, if the operating system is sufficiently recent; if not, we use the old method.

It’s also automatic when importing text clippings from the desktop.

There’s not currently an action, but I agree there ought to be.

2 Likes

Gotcha. I don’t think I’ll be able to use the Explode function for what I’m seeking, so I guess I’ll just maintain the old method – and wait for a new action that will accomplish this!

The old method works fine, but I’m very excited to see the new one…!

Thanks.

That’s oblique. What is it that’s not working? some examples would help.

I just mean that for the purposed of quickly creating note titles from the note text body, it seems like @eastgate’s original approach seems best for now. Explode is a terrific tool, but it might add a layer of complication to the process I’ve already got.

Hmm. “Complication” is subjective. That’s not push-back. There’s a solution. A better one is possible but might need a new feature for which no one has yet asked. so, the choice for us all is use what’s there or ask for a potential better. That’s not meant harshly. I quite see that the reply to your original question left it ambiguous as to exactly what he the changes were.

In which vein, back to the massive task of readying the v9 aTbRef version.…

Dear eastgate,
Might I ask you some questions?
Now I try to take a stump, to change from given originail naming
to plus $Text information in the note with Stamp behaviour.
$Name=$Name + Text.words(5) , I would like to insert [ - ] before [Text.words(5)].
EG : 20210701172454 - ZiplinkTest
([ - ] dash should have both sides space)
Thx and regards, WAKAMATSU

How about:

$Name = $Name +" - " + $Text.words(5);

I made a note “20210701” and added some text from your message above. Here is the result of my test (in v9.0.0):

Does that help?