I have an app that generates key commands in another app. I used to do it in Applescript studio but I have rewritten in Obj-C. Now I can't figure out how to make the other active in the foreground so I can start generating key commands.
Currently I am just running an Applescript call:
key = [[NSAppleScript alloc] initWithSource:@"tell application \"Pro Tools\" to activate"];
[key executeAndReturnError:nil] ;
The PID for Protools is 14925. I was thinking I could use NSApplications, but I don't think that is the right call.
Thoughts?