Changing the count to n rather than 0 using a modified unusedtitle?

The title might sound a bit odd, but what I’m curious about is, how could someone go about copying and changing the underlying javascript used in the unusedtitle macro, so that it can start it’s count from a different number, such as 1, or even 2?

I think I’ve located where the two parts of JavaScript are located in TiddlyWiki, however I don’t think the changes I’ve made are correct…

If there is anyone with experience with JS and a spare second, I’d like to learn what I’m doing incorrectly, and I’ll attach what I’ve attempted down below for reference as well.

It’s slightly modified JS from the $:/core/modules/macros/unusedtitle.js tiddler,
and the $:/core/modules/wiki.js tiddler.

unusedjournal.js.json (2.1 KB)

1 Like

OK, I’ve figured out what I was doing incorrectly.

Seems like I didn’t full rename all of the baseName to baseJournal, so I was getting an undefined error.

Here’s a working version!

Now, I don’t 100% understand JavaScript, but I’m going to spend a bit of time to try and change it so that the count (var c) can be set in the macro itself, rather than having it always start at 2 for this instance, so that is someone wants to say, start making meeting notes with the count of 30 (because I dunno, favorite number I guess?) they can! (hopefully.)

Edit: cleaned up the JS in the two tiddlers, I’m sure the previous way that I did it by copy/pasting segments would have caused an issue later down the road, so while I tinker with things to change the var c to n (and later change it in the <<macro>>) here’s the corrected working tiddlers.

unusedjournal.js-working.json (2.6 KB)