Reputation: 18477
I have a use case where I'd like my app to give focus to a specific running application. How do I do that?
Upvotes: 1
Views: 527
Reputation: 28242
If you know the application's bundle id (and only need to target 10.6+), you can do:
NSRunningApplicatin *app = [NSRunningApplication runningApplicationWithBundleIdentifier:@"com.foo.someapp"];
[app activateWithOptions:NSApplicationActivateAllWindows];
Upvotes: 2
Reputation: 212969
Just send a chunk of AppleScript from your app, e.g.
tell application "Some other app"
activate
end tell
Upvotes: 3
Reputation: 15597
If the other app has registered a custom URL scheme, you can launch it by submitted a URL with that scheme.
Upvotes: 0