Really? Is it not directly in front of you?
How did you configure Preferences / Folder Tree / Selection Events?
Here's a user command script that should do what you want.
function OnClick(clickData) {
var cmd = clickData.func.command;
cmd.deselect = false;
cmd.RunCommand('Go TABPOS=first');
cmd.RunCommand('Go PATH="' + cmd.files(0) + '"');
}
as XML
<?xml version="1.0"?>
<button backcol="none" display="icon" textcol="none">
<label>UC38321</label>
<icon1>#usercommand</icon1>
<function type="script">
<instruction>@script JScript</instruction>
<instruction>// https://resource.dopus.com/t/looking-to-always-open-tree-selection-in-the-same-tab/38321</instruction>
<instruction />
<instruction>function OnClick(clickData) {</instruction>
<instruction> var cmd = clickData.func.command;</instruction>
<instruction> cmd.deselect = false;</instruction>
<instruction> cmd.RunCommand('Go TABPOS=first');</instruction>
<instruction> cmd.RunCommand('Go PATH="' + cmd.files(0) + '"');</instruction>
<instruction>}</instruction>
</function>
</button>