I'm trying to find a way to automate bringing a web browser to the front (ie - give it focus, make it visible on the screen) based on an event that happens in a web page. I have full control over the webpage, so I can make it do whatever I need to in order to trigger this.
I need to have several apps open with a web page in the background which is monitoring some video cameras. When a video camera has motion, I need the web browser window to come to the front so it's visible instead of whatever app was being used.
I was thinking something similar to what this guy was trying to do : How to bring application to front every 15 minutes on Mac OS X Lion?
I was thinking of using AppleScript to run in a continuous loop, and once a second check the open page in Safari, scan for some change and then send "activate" command to Safari to bring it to the front. Is this how I should go about this, or is there a better way?