Exploding title and body of file

My settings must be wrong.
FILE TO BE EXPLODED

MY OBJECTIVE:
The title should appear in the title of the exploded note. The Description should be the body of the note.
MY SETTINGS

MY RESULT

Maybe select “Remove title from text” can help.

Here is one way to do it. there are many others.

First, you’ll want to explode on the line break.
Next, you’ll want to use action code, i.e., .split operator and variables, to parse the name and text.
You can write this action code in the explode dialog box, but I find it easier to write it in a stamp and have the explode call the stamp.

As “First Sentence” is selected, Tinderbox is parsing the $Text and everything before the first “.” is going to the $Name.

Once this is done I want to clean up the $Name and the $Text.

Here is my action code:

$Prototype="pNote"; //Applies a prototype that shows the Subtitle
$Text=$Text.replace($Name,""); //Removes the $Name from the text.
var:string vList=$Name.split(" -"); //Populates a list variable by splitting the name at the hypen.
$Name=vList.at(0).replace("Title ",""); //Pulls the first item from the list and populates $Name.
$Subtitle=vList.at(1).replace("\.",""); //Pulls the second item from the list and populates $Subtitle

Note, your pattern has an inconsistency. the hyphen in the second line does not have a space before it, nor doe the /N. this affects the regular expression pattern matching. Also, what is the intention of the “/N”? Are you attempting to get a line break? If so, you’d want to use “/n”; however, you really don’t need this as the explode will take care of that.

The .replace removes unwanted characters.

Question: is the above your action pattern, or do you have a different one? If you manipulate your source, we might be able to come up with different patterns for the explode.

Here is a sample file:
TBX L - Explode and Prase Note Name and Text with Action Code.tbx (178.7 KB)

1 Like

Good demo above! Don’t forget to look at aTbRef, at articles on Explode pop-over and Exploding Notes.

1 Like

You want to write “\n” to denote a carriage return; you’ve written “/n”.

1 Like

Yup, good catch!!! Fixed the typo above.

1 Like

Everything worked. I simplified.

There is no \n on a Japanese Mac keyboard. It turned out to be an unnecessary complication. TbRef would have made no sense if I did not watch the video made by @satikusala. Thank you for your kind instruction Michael.

1 Like

To clarify, there is no \n key. you type a backslash \character and then an n. I do appreciate a Japanese keyboard has different characters on it but, this article would suggest it has an ‘n’ key. I suspect you may need to change OS input language from Japanese to US English to get a ‘n’ from the key, but such issues fall outside Tinderbox and are OS-level issues so better addressed on an Apple forum. I suspect it is the same for the backslash character. You might find it useful to use a tool like TextExpander or KeyboardMaestro to make macros to allow you to insert text like \n withuot fiddling with OS keyboard input settings.

Ouch! In reading the articles on Explode (the dialog and the process) where do you get stuck?

The Explode feature has been in Tinderbox since it launched >20 years ago and though I’ve updated the articles as features have been improved, to date no one has ever reported an issue with the articles making sense. I’m happy to improve the articles and but I need something actionable to work on. Is it the terminology? The steps needed? …etc.