If I use var Lister = activateTabData.oldtab.lister;
I get the error "Vars is null" when closing a tab.
// Called by Directory Opus to initialize the script
function OnInit(initData)
{
initData.name = "Test";
initData.version = "1.0";
initData.copyright = "(c) 2023 Ken";
// initData.url = "https://resource.dopus.com/c/buttons-scripts/16";
initData.desc = "";
initData.default_enable = true;
initData.min_version = "13.0";
}
// Called when a new Lister is opened
function OnOpenLister(openListerData)
{
if (!openListerData.after)
return true
DOpus.Output("The tabs of the lister have been opened")
openListerData.Lister.Vars.Set("exec", 0);
}
// Called when a tab is activated
function OnActivateTab(activateTabData)
{
var Lister = activateTabData.oldtab.lister;
if (!Lister.Vars.Exists("exec")) return;
DOpus.Output("Activate tab")
}
If I use var Lister = activateTabData.newtab.lister;
it works fine.