Re: Invoking another app's service?
Re: Invoking another app's service?
- Subject: Re: Invoking another app's service?
- From: Matt Gemmell <email@hidden>
- Date: Tue, 28 Jan 2003 03:18:39 +0000
On Tuesday, January 28, 2003, at 02:51 am, Rams wrote:
Is there any way to call another app's service programmatically from
my app? For instance, open a URL in Safari with a url string from my
app?
If the app exports a service, you can call it explicitly with:
NSPerformService(NSString *itemName, NSPasteboard *pboard);
But Safari doesn't export an "open URL" service, as far as I know.
However, if the user's default browser is Safari, you can just use
NSWorkspace's openURL method, like this:
[[NSWorkspace sharedWorkspace]
openURL:[NSURL URLWithString:@"
http://www.site.com/"]];
I'd say it's probably better to always use the user's default browser,
rather than to hard-code the use of a certain one (particularly one
that doesn't yet ship with the OS). :)
Best,
-Matt
--
Matt Gemmell
Scotland Software
http://www.scotlandsoftware.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.