CurTab
CurTab(x)
The CurTab internal function (introduced in BR! 4.16) can be used to return the active tabbed window number.
The required parameter X needs to be any open window within the tabbed group.
CurTab will return the clicked window number within the Tabbed group of windows.