I don't think Opus keeps a history list of source tabs you could access. But we can keep our own and use v13's new Evaluator to create a dynamic button
Give this a try. Might need a bit of fine-tuning. I leave adding the MOVE functionality to you as a little exercise
function OnInit(initData) {
initData.name = 'LogLastSource';
initData.version = '2023-10-06';
initData.url = 'https://resource.dopus.com/t/copy-move-to-last-active-source/46183';
initData.desc = '';
initData.default_enable = true;
initData.min_version = '12.0';
}
var vec = DOpus.Create().Vector();
function StoreLastSource(tab) {
if (!tab) return;
if (!tab.path) return;
vec.push_back(tab.path);
if (vec.count > 2) vec.erase(0);
DOpus.Vars.Set('lastSource', vec(0));
// DOpus.Output('lastSource: ' + vec(0));
}
function OnActivateLister(activateListerData) {
if (activateListerData.active) return;
StoreLastSource(activateListerData.lister.activetab);
}
Save EventLogLastSource.js.txt to
%appdata%\GPSoftware\Directory Opus\Script AddIns
Then place this button on your toolbar (paste the XML).
@label:"Copy TO=""" + Val("$glob:lastSource") + """
@nodeselect
Copy TO="{=Val("$glob:lastSource")=}"
Button as XML
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
<label>@label</label>
<icon1>#clipcopy</icon1>
<function type="normal">
<instruction>@label:"Copy TO=""" + Val("$glob:lastSource") + """</instruction>
<instruction />
<instruction>@nodeselect</instruction>
<instruction>Copy TO="{=Val("$glob:lastSource")=}"</instruction>
</function>
</button>