This will open my website in Safari on macOS, no matter your default browser: x-safari-https://christiantietze.deTry it! Depending on your platform and browser, this may not be clickable or not do anything (I have no clue what Android browsers would do with this).
If you ever wondered how to programmatically trigger a click on a link in a NSTextView, here’s one way to do so. This assumes that clickable links are not stored as temporary attributes in the NSLayoutManager, but permanently as part of the “model” in your NSTextStorage. You can then ask the storage for the attribute at the cursor/insertion point location: