Get tab ID/number?

Is there a way to get the tab number from an RPA command (or via javascript) while the macro is running? The reason I’m asking is that if you’re doing things in multiple tabs at the nodisplay speed the macro will sometimes go to the wrong tab, it’s an intermittent bug that’s hard to recreate consistently but it does happen. Executing the selectwindow command again fixes it, so what I’d like to be able to do is to handle such errors by having a check for the tab number.

Example: I want to use selectwindow | tab=2 to go to tab 2, and then have the macro return the tab number as the next step, if the numbers match then macro carries on, if not it goes to the selectwindow step to try again.

I’m aware that I can navigate to tabs using their titles, it just doesn’t work well when multiple tabs have the same title

This is not yet possible but a good idea!