Open von opened 1 month ago
I found the following work around: create the hyperlinked text using html and then covert it to styledtext using getStyledTextFromData().
stext = hs.styledtext.getStyledTextFromData('<a href="https:www.mit.edu">Test text</a>', "html")
hs.pasteboard.writeObjects(stext)
I also found some ways to do it using system calls as well (e.g.).
Short version: I'd like to be able to use hs.styledtext.new() to create some styled text which is a hyerperlink but that function doesn't seem to respect the
link
attribute.Details:
If I copy some hyperlinked text into the pastebuffer outside of Hammerspoon and then examine it, I see the
link
attribute in play:But if I try to use
hs.styledtext.new()
to create a hyperlink, the link attribute seems to be ignored:Since the hs.styledtext documentation doesn't mention
link
being supported, I assume the above behavior is not a bug and hence this is a new feature request.