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 .
D&D 2024 has arrived! Pre-Order the new core rulebooks now.
Create a free account

Calling query macros from command buttons

Hi, I am trying to set up a set of command buttons, that when clicked, will call a specific macro. However, these macros have queries inside them, so calling them with # doesn't seem to work.  Am I missing something, or is this just not possible? Thanks
You can call queries within queries, however to do so you will need to look into the  Advanced Usage for Macros . Specifically the HTML equivalents for certain characters. Doing this will unfortunately remove the ability to do #macroName outside of the nested macro. Because of this, I would suggest using  API Command Buttons instead of trying to nest the queries.
I tried to understand the advanced usage of macros, but couldn't grasp how it relates to what I was trying to do. Sorry, if I may ask a little bit further: How would I make this: [AOE Marker](#AoeShortcut_✸) Call This: !areasOfEffectApplyEffectAtToken @{target|token_id} ?{Specify radius:} ?{Which effect?|Dawnbringer|Fireball|Grease|Hypnotic|Spirit_Guardian} But only when I click on the api button.
So when using the API command button to call a macro, you need to put a new line character before the macro name. That way when the button is pushed, the macro will work properly. We put the new line in using it's html equivalent, 
. So the button code should now be: [AOE Marker](!
#AoeShortcut_✸) I am assuming the the code for the AoeShortcut_✸ macro is !areasOfEffectApplyEffectAtToken @{target|token_id} ?{Specify radius:} ?{Which effect?|Dawnbringer|Fireball|Grease|Hypnotic|Spirit_Guardian}
Aaaah, I understand now. I thought its purpose was to replace or add to the bracket, and was confused why it wasnt working. Thank you for clearing that up for me. (and yes that was the code of the macro). Thank you btw, it worked exactly as I had hoped.