swapTo window swapping

You've posted code as a quotation. You need to format it as code. Please see Wiki - how to post code on this forum and use the pencil icon button to edit your post. It's especially important to reveal Python indentation (or none). Thanks.