How to make an Applescript Window become the main/highlighted window?

See Switch Audio Source, which uses the command-line program SwitchAudioSource.