AutoControl can detect when a window gains focus, but it cannot read the window title.
It can, however, read the title of the active tab in that window.
Here's how it's done:
The
ACtl.getTabInfo() scripting function gives you the active tab title. Then you can use that information to decide what to do.