OSX Grid Selector Script

On OSX environments, if you have multiple viewers and multiple grids to connect to, you can try the following AppleScript (one could do something similar with a shell script). Feel free to copy and modify for your own use.