Shareda,
I tend not to need what you are asking for because I close unwanted tiddlers, use close others or close all as needed.
However I can see how this may be useful. I have also made a tools to track the current sessions history.
In this case you are asking that on opening one tiddler it closes another. For this reason I suggest creating a button to do the opening and use that to open tiddlers and simultaneously close the "excess tiddler". You can use the link catcher to capture the name of the tiddler to open, then use its actions parameter to trigger open tiddler and the close.
Lets assume you are happy to use the story list this solution works, but since it will itself be closed I have put it in the sidebar
Tag with $:/tags/SideBar
\define close-tiddler-action(tiddlername)
<$set name=tiddlername value="$(currentTiddler)$" emptyValue=<<currentTiddler>> >
<$action-sendmessage $message="tm-close-tiddler" $param="SampleWizard"/>
</$set>
\end
\define open-close-behind()
<$list filter="[enlist{$:/StoryList!!list}nth[3]]">
<$action-sendmessage $message="tm-close-tiddler" $param=<<currentTiddler>>/>
</$list>
<$action-navigate $to=<<navigateTo>>/>
\end
$:/temp/last-opened=<$link to={{$:/temp/last-opened}}/>
<$linkcatcher to="$:/temp/last-opened" actions=<<open-close-behind>> >
{{TableOfContents}}
</$linkcatcher>
Note:
- for testing this closes the third, alter nth(3] to nth[10]
- The close-tiddler-action definition is not in use
Regards
Tones