I am wanting to be able to look for a program to open.....

Say i have a program thats running i want it to continue to search until like say word pad opens......

How can i do this?