Currently there appears to be no way to query what tab group is loaded.
I have a saved set of tabs called 'Employees' that I can load with TABGROUPLOAD. Before I load it, I want to save the current tab set as 'LastUsed' so I can reload it later, so I do a TABGROUPSAVE, then TABGROUPLOAD.
This is controlled by a toggle on a toolbar button. I use a global variable to remember whether I have the Employees or LastUsed group loaded, so the toggle and switch between them.
The problem comes when I reboot my PC. The global variable is lost so I don't know which group is loaded. This can lead to TABGROUPSAVE saving the Employee group overwriting the LastUsed and therefore I lose all the tabs I had open from before loading Employees. If there was a builtin variable naming the currently loaded tab group, I could use that.
Here is the script I use:
@toggle:if $glob:EmplGrp
@ifset:$glob:EmplGrp
@set glob:EmplGrp
Go TABGROUPLOAD "LastUsed" TABCLOSEALL=yes
@ifset:else
@set glob:EmplGrp=on
Go TABGROUPSAVE "!both,LastUsed"
Go TABGROUPLOAD "Employee" TABCLOSEALL=yes