Re: Better way to launch applications in Cocoa
Re: Better way to launch applications in Cocoa
- Subject: Re: Better way to launch applications in Cocoa
- From: Ali Ozer <email@hidden>
- Date: Sat, 25 Jun 2005 18:09:44 -0700
As of Panther NSWorkspace has a launchAppWithBundleIdentifier:...
method which lets you specify launch options, so:
[[NSWorkspace sharedWorkspace]
launchAppWithBundleIdentifier:@"com.apple.TextEdit"
options:NSWorkspaceLaunchWithoutActivation
additionalEventParamDescriptor:nil
launchIdentifier:NULL];
If you don't have a bundleIdentifier for your app, you can use the
openURLs:... variant, passing your app's path as the URL:
[[NSWorkspace sharedWorkspace] openURLs:[NSArray arrayWithObject:
[NSURL fileURLWithPath:@"/Applications/TextEdit.app"]]
withAppBundleIdentifier:@""
options:NSWorkspaceLaunchWithoutActivation
additionalEventParamDescriptor:nil
launchIdentifiers:NULL];
Ali
Begin forwarded message:
From: matt jaffa <email@hidden>
Date: June 25, 2005 14:56:22 PDT
To: email@hidden
Subject: Better way to launch applications in Cocoa
Reply-To: matt jaffa <email@hidden>
Hi,
In my System Preferences app I made I use it to launch a helper
app. I am using
[[NSWorkspace sharedWorkspace] launchApplication:@"PATH"].
This launches my app fine but I want it to not take away focus from
the System Preferences app I wrote. Is there some other API that I can
use that won't take focus away from my app? I tried messing around
with Carbon API LaunchApplication(...), but didn't get it working and
is kinda a hassle to try get it working.
Thanks,
Matt
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden