Look at the error message, it gives you a lot of information:
if 'Google Chrome' in new_window_name:
It tells you which file, and what line: "ATT.py", line 58:
if 'Google Chrome' in new_window_name:
It tells you what the problem is:
argument of type 'NoneType' is not iterable
So, the
in
operator expects a collection - understandably - but
new_window_name
doesn't hold a collection, it contains
NoneType
instead.
So look at the line which loads
new_window_name
:
new_window_name = get_active_window()
and that means that the method call doesn't return a collection. So look at the method, and use the debugger to find out why.
We can't do that for you, as it needs your code running on your system with your data in order to start working out where the
None
is coming from.