Program Automated?

I'd start with the program on the PC that figures out which program you're running - it's not especially difficult, but non-trivial nonetheless. Once you have that, it should be a fairly simple matter to add code to send instructions to the arduino over the serial port or UDP, whichever way you decide to connect it.