Active a tab via scripting?

Good day to everyone, I was trying out to bring to front an specific tab from a script, althought it seems something I can't achieve, any help or idea about how to do this?.
I want this because I'm making a litle script to add a request dialog when trying to close a locked tab. Since you can close any tab (not only the active one) I want to add support in my script to make the related tab visible when needed, althought it seems something you can have problems to do, especially if there's duplicate tabs.
Suggestion: Some methods in the tab object to active, close, etc would be a nice feature!!!

You can have the script run a command like Go TABSELECT=5 to select the 6th tab (TABSELECT=0 is the 1st tab).

Snippet: Enumerating listers and tabs shows how to find the tab, so you know which number it is.

To close a tab from the script, you can pass the tab object itself to the command. There's an example of that in the Go TABCLOSE docs.

I'm sorry but that example is not helpful, because of the lack of handle duplicate tabs(tabs with the same path). Perhaps something like you mention early, something like GO TABSELECT=«tab object» would be a nice addition.

Where do paths come into it? You can compare two tab objects to see if they are the same tab.

yeah you're right. however compare one by one especially if you have plenty, every time a tab is closed, is time wasting. wish sometimes that Go Tabselect accept also tab objects.

Computers can compare things very quickly, it shouldn't be a problem for a script to do it.