0

I have an NSAttributedString which has multiple links (with NSLinkAttributeName) in it. Clicking on the link, launches the web browser, and loads the page. Instead, I would like to intercept it and show the link in a webview in my application itself. Is there an easy way to do this (outside of subclassing NSTextField and implementing a custom mouseDown: - which might make me lose other functionality like selection etc.)?

Thanks

georgemp
  • 716
  • 10
  • 21

1 Answers1

0

It sure doesn't look like they make it obvious how to map it directly to a different command. One roundabout idea would be to register a custom URL handler when you start the app for a unique URL scheme (e.g. http_myapp_internal://, and use that custom URL scheme in your link). I would hope there's an easier way, but this should work.

The following SO question seems to illustrate how to implement this idea:

When an OS X app is launched by a registered URL scheme, how do you access the full URL?

Community
  • 1
  • 1