Put hypertext link in the clipboard

I’m using the old four letter codes to create a hypertext link for the clipboard:

c.AddRawData(“https://www.apple/com”, "url ") //the actual URL
c.AddRawData(“Apple”, “urln”) //what the user sees

I’d like to use modern UTIs instead, but I can’t find the equivalents for "url " and “urln”

Does anyone know what they are?

To answer my own question, they are public.url and public.url-name, respectively.

3 Likes

sorry, but mind sharing the result of your search?
might come handy :slight_smile:

I did, it’s posted directly above yours.

2 Likes

excuse my noobiness with clipboard, i tried your example

this compile

but since addRawData is marked depreciated, i tried new API

but it doesn’t compile

plus in the first example, didn’t see nothing in the textarea

thanks

plus it is marked nowhere in the doc you could put 2 strings in parameter

Those methods use assignments:

Var c As New Clipboard
c.RawData("public.url") = "https://www.Apple.com"
c.RawData("public.url-name") = "Apple"
c.Close
1 Like