#Calling a macro from the Notes popup with new HTML notes

1 messages · Page 1 of 1 (latest)

mortal pendant
#

I'm trying to call a lib macro from an HTML link in the Notes popup when clicking on a object. I have the HTML string like so:

<a href="macro://TEST@lib:MacroTest/all/Impersonated?">...and...<br> ...chittering...</a>

In the Notes popup the text appears using link styling, but on click does nothing.

If I just paste that <a> block into the chat, I can click on the link and it runs the macro correctly. Similarly, I can put an HTTPS link into the Notes popup like

<a href="https://google.com">...and...<br> ...chittering...</a> and clicking the link in the Notes popup opens Google.

spare quartz
#

How do you know the macro is not running from the Notes popup? If it tries to generate output, that output is probably being ignored. But if you put a broadcast() call in it and even that doesn't show up in the chat, then I'd say it isn't running.

mortal pendant
#

I'll give that a try. It's just since I could get the output fine from pasting that link into the chat window, and I have the output argument set to "all" I assumed it would similarly output the text when clicked in the popup.

#

Hmm even with broadcast in the macro it doesn't work when run from the popup window.

#

works fine clicking the macro, works fine from macroLink, fine from pasting that HTML into the chat.

spare quartz
mortal pendant
#

Ok thanks. I just threw a couple tokens in that demo file with 1 working link, 1 broken link. Copy/paste the broken link from the notes into the chat box and it works fine.

spare quartz
#

I looked for all the "usual" stuff and I don't see any problems with the configuration of the lib: token (ownership, visibility, macro not-editable-by-players) or of the syntax of the URL. I'm going to chalk it up to a bug (please file an issue on GitHub -- thanks!).

Unlike the asset:// scheme, which registers as a URLStreamHandler and therefore works everywhere that a regular URL would work, the macro:// scheme is hard-coded in various places in the code. This means any use of it must also have hard-coded checks or it won't work.