\end
<$button actions=<<addLecture>>>New Lecture</$button>
Then, to use it:
1) Create a tiddler with a given course title (e.g., "Basket Weaving 101")
2) Enter whatever text you like (e.g., a course description, professor's name, room #, etc.)
3) Include the following somewhere in the content:
How it works:
* The NewLectureButton tiddler displays a button that triggers an "action macro" (addLecture) when pressed. This macro performs the following steps:
* "$vars num=..." calculates the next lecture number:
** Find all tiddlers that start with the course name (prefix<currentTiddler>)
** Get the most recent one (sort[modified]last[])
** Remove everything except the last lecture number (split[Lecture #]rest[])
** If this is the first lecture, use default number (else[0])
** Add 1 to the last lecture number (add[1])
* "$vars newTitle=..." constructs the new title by adding " Lecture #n" to the end of the course name (i.e., the current tiddler title)
* "$set name=newTags..." constructs a new tag from the course name, allowing for spaces in the course name
* The action-sendmessage creates a new tiddler, opened for editing, using the calculated title, tags, year, month, and day
Let me know how it goes...
enjoy,
-e