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

How to quote an apostrophe character in API

I have a macro to print my player's passive perceptions so I can check them all at once quickly when I need to check them.  The macro looks like this: /w gm &{template:default} {{name=Passive Perception}}{{Lester [[10+@{Lester Tweevle|perception_bonus}]] Storflick [[10+@{Storflick|perception_bonus}]] Bart [[10+@{Bartholomew Trapp|perception_bonus}]] Nelgraz [[10+@{Nelgraz|perception_bonus}]] Ralibar [[10+@{Ralibar|perception_bonus}]] Root [[10+@{Root Ben'Grognard|perception_bonus}] Khan [[10+@{Khan|perception_bonus}]] }} I'm having problems with the Root entry. The apostrophe in the name causes problems.  I've tried using  @{selected|character_id} to grab the ID of the character from the token and using that in the macro but that doesn't work either.  Can anyone tell me a way to get around this problem without telling the player he has to change the character's name? Thanks.
1615147464
GiGs
Pro
Sheet Author
API Scripter
I'm surprised it doesnt work - check if the character name is using the same type of apostrophe (there are 'smart' apostrophes with a slight curl to them). If that's not the issue, the best fix is to change the character name. Because this will be a recurring problem for every macro that references that character's name.
1615150936
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Try changing the character's name in the name field and in the macro to Root Ben’Grognard. This uses the curly typographer's apostrophe and might circumvent the issue (and look better). You could also try Root [[10+@{"Root Ben'Grognard"|perception_bonus}]
Changing the apostrophe worked.  Putting it in double quotes as @keithcurtis suggested, did not. I still don't understand why using the character ID obtained from @{selected|character_id} did not work but, at least I have a fix. Thank you all for your suggestions!