an existing note is moved to the current container, either via manual drag or via action code.
a new note is created as a child of the current container (eve if it is the first child to be created for a note that isn’t yet a container)
Little used, but there, is an OnRemove action too. It runs, unsurprisingly, on a child note when it is removed from the current container. Note: deleting a child note is not a removal event as there is nothing upon which to act.
Just as a side question - are the square brackets a misspelling there? I know it shows like that in TBX help as well. However, the formula works without them and the first one is in an odd place before comma.
the [square brackets] are an, unofficial, standard notation in code documentation. Anything in square brackets is optional, i.e. you don’t have to use it.
Thus you can generate a link from ‘Note A’ with no link type (i.e. type is ‘untitled’):
Or, to the same but with a type ‘explains’:
linkFrom("Note A", "explains");
As, in a default document there is not per-defined type ‘explains’, this is also added to the documents’s defined link type.
It’s simply not possible to document in detail, every variation in every context. For instance, aTbRef expects the reader, if they don’t already know, what scope implies or else follow links that explain it. So informed they will understand why only one of these uses quotes:
linkFrom(children); // designator names are not quoted