In layout mode, you can select each such tab and use the inspector to give it a unique object name using the name box at the top of the position tab. Then you can use the go to object script step at the end of your script to select the tab you want selected when the script ends.
Wow you are fast - thanks! - did what you suggested now this happens:
Used tabs and running a script when someone selects a different tab. The script accesses a different layout and I want to be able to return to the original layout and to the selected tab - not the default tab.
All tabs have object names which are captured into a global variable when the script runs (triggered with OnObjectModify for the tab). The script access another layout and then returns to the layout with the tabs. I use go to object to move to the front tab captured in the global variable. All of this works but the script drops into an endless loop as the got to object seems to be firing the OnObjectModify trigger.
You appear to have two threads on the same issue. See my response to your other post for an answer.