
I have a TokenAction macro "@{selected|attacks-macro}", that will display the output from the "All Attacks" button on the sheet. But, now I want to have a menu of action buttons whispered to a player on their tokens turn, including things like the "All Attacks" button, but I can not get it to work when trying to include a button for "attacks-macro". As part of troubleshooting I have hard coded a Character ID and it works if I reference something like an attack roll with the code below: var actionButtons = `{{[Attacks](~-KIjpzaT3NPTMhRgp1LF|repeating_weapon_-kiju5i0kpp5k0noyji7_attack-roll)}}`;
var actionTemplate = `&{template:pf_generic} @{${charName}|toggle_rounded_flag}{{color=@{${charName}|rolltemplate_color}}} {{header_image=@{${charName}|header_image-pf_generic}}} {{character_name=@{${charName}|character_name}}} {{character_id=@{${charName}|character_id}}} {{subtitle}} {{name=Actions}} ${actionButtons}`
var actionBox = `<div style='border: 3px solid #808080; background-color: ${bgColor}; padding: 1px 1px;'> ${actionTemplate} <div style="clear:both;"></div></div>`;
sendChat('', `/w "${charName}" ${actionBox}`); I get the pf_generic template whispered to the player with an "Attacks" button. When I click on the attack button it makes the repeating_weapon attack roll as expected. Now, if I change the "repeating_weapon_-kiju5i0kpp5k0noyji7_attack-roll" to "attacks-macro" as seen in the code below (first line): var actionButtons = `{{[Attacks](~-KIjpzaT3NPTMhRgp1LF|attacks-macro)}}`;
var actionTemplate = `&{template:pf_generic} @{${charName}|toggle_rounded_flag}{{color=@{${charName}|rolltemplate_color}}} {{header_image=@{${charName}|header_image-pf_generic}}} {{character_name=@{${charName}|character_name}}} {{character_id=@{${charName}|character_id}}} {{subtitle}} {{name=Actions}} ${actionButtons}`
var actionBox = `<div style='border: 3px solid #808080; background-color: ${bgColor}; padding: 1px 1px;'> ${actionTemplate} <div style="clear:both;"></div></div>`;
sendChat('', `/w "${charName}" ${actionBox}`); It doesn't work, instead I get the error message "No ability was found for %{-KIjpzaT3NPTMhRgp1LF|attacks-macro}". I'm guessing this is related sendChat docs which say "You cannot use macros.", but I'm confused why it works for the attack as I think that is also a macro (but I'm probably wrong). I thought maybe there was a way to get what I was trying to do to work with an API Command button, but I tried several permutations and was unsuccessful. So, two questions: 1.) Is there a way to do what I am trying to do? 2.) Why does the above work for something like the attack roll, but not the attacks-macro? Thanks! Joe