Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Using a macro inside

Hello, I want to put a macro inside the href of a link, like <a href="#mymacro"... Is this doable somehow? p.s.: I put html in the title, so it was erased
A lot more context would be helpful. What problem are you trying to solve, or what are you trying to accomplish?   Where are you trying to use the html link? In chat? A handout? A character sheet?  What does the macro do? What game are you playing and what character sheet are you using?
1706397211
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Also, Are you trying to put it in a script?
So: - Problem: I render a chat menu where the player can call several character's macro, in each macro there is a call to an API command. For example <a href="#cast-my-spell">casts</a>, the content of the macro cast-my-spell is !cast-my-spell - The HTML link is sent to the chat - Game is dnd 5e original sheet The chat menu is created by a script that reads the sheet, does some logic inside, then creates a macro called "Show-Spell-Menu". This macro is created inside the character and the same character has all the other macros. So the players uses the macro "Show-Spell-Menu", the spell menu pops up in the chat with all the links to the other macros.
Bumperino This is the macro i want to call from the link: This is where I want to call the macro:
Take a look at this  Universal Statblock Macromule  and see if that is something like what you are looking for.  If not, then you’ll have to post the code for whatever macros you are using (not just screenshots - it’s hard to copy code from a picture) to see if it’s possible to do what you’re looking for. 
In the end I managed to do that with: const href = `~ ${ this . spellbook . name } |aoe- ${spellSlug} _i` ; macroPiece += ASB. renderA ( 'i' , ASB. getNormalizedMacroString (href)); // <a href=href etc... The link you provided is still very interesting for what I've to do, thanks.