You will need to use a $button widget to modify a tiddler and set a field value.
Place the following into Tiddler 2:
<$button> set sequence
<$action-setfield sequence={{{ [enlist{!!depends-on}get[sequence]nsort[]last[]add[1]] }}} />
</$button>
Notes:
* enlist{!!depends-on} gets the list of tiddlers that the current tiddler depends on
* get[sequence] gets the sequence field value from each of those tiddlers
* nsort[] does an ascending numeric sort of the sequence numbers
* last[] gets the last number (i.e., the max value)
* add[1] increments that number
* the result of the entire filter (the new number) is then assigned to the sequence field of the current tiddler
Note: you can put the above button into a separate tiddler (e.g., "SetSequenceNumber") and then transclude it using:
Alternatively, you could tag the SetSequenceNumber tiddler with $:/tags/Macro, containing:
\define SetSequenceNumber()
<$button> set sequence
<$action-setfield sequence={{{ [enlist{!!depends-on}get[sequence]nsort[]last[]add[1]] }}} />
</$button>
\end
Then, to invoke the macro, you would add the following in "Tiddler 2"
enjoy,
-e