Is there a way to switch between tabs while running tabs loop

If I add a command selectWindow | tab=0 it will be added to the loop and mess all.

So I need the tabs loop to be done and after it I can go back and finish the process for each tab.