I have not used it, but I was reading about SKScheMa today and it sounds like it could do this.
- emulates a screen tap or a keyboard input
- supports scripts which are to be executed at the time specified as well as directly from Explorer or with a shortcut in Start Menu
- watches launched and closed programs (by window name) and performs different actions for these events
http://www.s-k-tools.com/skschema/skschema.html