For your second question read this post from @Fox ,
maybe its what you need. Its in Russian, but you can
use translator. There is an example script too >
Hi,
im not sure if you know, but on bablosoft there is a russian majority, there is an extra russian section.
There is a function for switching tab, just search Tab and it will show all interactions with tab.