So I’ve been experimenting with NotebookLM (which has come up on this forum before), and one of my experiments was to see if it could do what ChatGPT could not, namely write Tinderbox action code.
Since NotebookLM depends on user-supplied documents, I scraped all of Mark Anderson’s action code pages into a single text document and fed that into a Notebook. This was quick and dirty and did not give Notebook a full picture of Tinderbox’s capabilities.
Still, I got some pretty good results. When Notebook got things wrong it was usually because it lacked documentation on how attributes, designators, prototypes, or other features of Tinderbox work. It only had action codes. So I’ll likely feed that information in as I can. Which leads me to my question, most likely for Mark Anderson (@mwra). Is there a way to download the entire Tinderbox reference file? Or is that asking too much?
Here are two question/code pairs that worked out. The full answers, with citations, are too long to post here. Answers like this made me want to continue the experiment by adding more documentation.
Me: Assign a random color to a note.
(I already had a stamp that did this; I just wanted to see what Notebook came up with.)
NotebookLM code: $Color = rgb(rand(256), rand(256), rand(256))
In other words, randomize the arguments to the rgb() function. This is exactly how I did it, only I used 255. Rereading the rand() documentation, I see why Notebook used 256. I asked this question a few more times (clearing chat memory between attempts) and got round(rand() * 255)
, which followed Mark’s explanation of the original rand() method. But I think the first answer is better.
Me: I'd like to apply a stamp to a note that colors the note's children and grandchildren. Each child should get the color red and the grandchildren should be colored blue. Unless the $Name contains the word "duck", and then the child or grandchild should be colored purple. Use HTML color codes for the colors.
NotebookLM code:
// Collect children
var:list vChildren = collect(children,$Path);
// Color each child
vChildren.each(aChild) {
if($Name(aChild).icontains("duck")) {
$Color(aChild) = "#800080"; // purple
} else {
$Color(aChild) = "#FF0000"; // red
}
// Collect grandchildren of the current child
var:list vGrandchildren = collect(children(aChild),$Path);
// Color each grandchild
vGrandchildren.each(aGrandchild) {
if($Name(aGrandchild).icontains("duck")) {
$Color(aGrandchild) = "#800080"; // purple
} else {
$Color(aGrandchild) = "#0000FF"; // blue
}
}
}
Not too shabby! Especially since it did not have access to the designators documentation. In subsequent attempts Notebook wrapped the loops in action(), which I don’t think is necessary. But by and large the next attempts were like the first.
I also fed the action code document into OpenAI’s custom GPT creator and got answers that were way off. And the GPT didn’t provide references. Much less useful, in my opinion.
I’m not trying to replace the forum or the TB reference file, but I can see using my Notebook when I’m feeling too lazy to write out a long loop or a set of if-else statements. Or if I’m halfway to a solution but need the other half. Or for debugging. I’ve also used it when the correct syntax for an operation has slipped my mind. Best of all, Notebook’s replies always include references to the original document so I’m never too far from Mark’s TBX reference.
Speaking of which, NotebookLM cannot replace the TBX reference. In fact it needs those documents to do anything, and it pays homage to those documents with frequent footnotes. I see this as a shortcut, and as with all shortcuts, it has benefits and downsides. And of course I may find that it’s still error-prone even after all the reference docs are uploaded. Seems worth trying though!