• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Invoking another app's service?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Invoking another app's service? (From: Rams <email@hidden>)

  • Prev by Date: Re: contextual menu in NSTableView cell
  • Next by Date: Re: Drawing gradients in views
  • Previous by thread: Invoking another app's service?
  • Next by thread: Drawing gradients in views
  • Index(es):
    • Date
    • Thread