I have a prototype called “口頭のインプット,” for which I use for my blackboard stories, cartoons, read-alouds, etc containers. Now, for the cartoon container which I call “教育番組”, I have a special edict as shown below.
As can be seen, I stick names of series in the “教育番組” container, and I add names of episodes in the container of said series. In the notes for episodes, I want to pull in $Type(grandparents) and $Series(parent). If the title of a note is, for example, KBG- Sesame Street, how can I make it so that only Sesame Street appears in the attribute for an episode note?
I saw that there was a .replace function in a thread for exploding notes, but I don’t know how to put the two together, especially when referencing to a generic “parent”.
This would turn “KGB- Sesame Street” into “Sesame Street”, but leave “Tales Of The KGB- uncensored!” unchanged. (.substr()) means “substring” — in this case, it skips the first four letters of the $Series and returns the rest.)
Yet another might be “Replace 'KBG- ’ wherever you find it.
$Series=$Series.replace("KGB- ","");
As you see, there are lots of ways to do this sort of thing.
I see! I am still trying to get the hang of coding in tinderbox (and coding in general). I don’t know why I didn’t think of just creating if statement that uses the abbreviation of the note instead of referring to a generic parent/grandparent note in the edict. I greatly appreciate your help!
A handy Web-based listing of Action code operators is here: Full Operator List. You’ll see there are a lot of operators such as .substr() designed for string (i.e. text) manipulation.