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

[Help]Tokenmod needs an alternative to quotes for names

You cannot use quotation marks in apichat button syntax.   [Name](!token-mod --set name#"?{Female Name?}")   The above button does not do anything when there are quotes in it.  I tried html escapes but I could not get it to work.  
1647095237
Andreas J.
Forum Champion
Sheet Author
Translator
You don't need the quotes around the query. !token-mod --set name|?{Female Name} works just as well as !token-mod --set name|"?{Female Name}" So you can do just: [Name](!token-mod --set name#?{Female Name?})
You do if there is a space in the name.  
1647104351
The Aaron
Roll20 Production Team
API Scripter
You can also use single quote for delimiters, does that work?
The Aaron said: You can also use single quote for delimiters, does that work? No, and its the same seeming issue with api buttons.  If you try to manually enter the button into chat to then click on, with either quotes or single quotes the chat message refuses to enter.  It sits there.  If you remove them then you can press enter.  
Actually it works with single quotes BUT, it now breaks something else.  The whole macro is: !set-gmnote {{Characteristics = [[1t[NpcCharacteristics]]] Ideals = [[1t[NpcIdeals]]] Bonds = [[1t[NpcBonds]]] Flaws = [[1t[NpcFlaws]]] Female Name = "[[1t[NPCFemaleFirstName]]] [[1t[NPCLastName]]]" Male Name = "[[1t[NPCMaleFirstName]]] [[1t[NPCLastName]]]"}} /w gm [Set Default](!token-mod --set defaulttoken) | [Send to Chat](!gmnote) | [SetFemaleName](!token-mod --set name#'?{Female Name?}') | [SetMaleName](!token-mod --set name#'?{Male Name?}') | [ToggleNamePlate](!token-mod --flip showplayers_name) When just the button is sent to chat, it works.  However now the whole macro fails to do the /whisper command at the bottom.  
To work around this issue I have put the name in quotes in the GMnote so that I paste it with quotes now.  Something about quotes and single quotes do not work with apichat buttons well or possibly whispers I dunno.  
I have caught the conflict finally.  It is very specifically when a /w gm is done with the above command: vtt.compiled.js:46410 Uncaught TypeError: Cannot read properties of null (reading '0') at HTMLTextAreaElement.select (vtt.compiled.js:46410:37) at $.<computed>.<computed>._trigger (jquery-ui.1.9.0.custom.min.js?1646945600:821:13) at $.<computed>.<computed>.menuselect (jquery-ui.1.9.0.custom.min.js?1646945600:5721:25) at HTMLUListElement.handlerProxy (jquery-ui.1.9.0.custom.min.js?1646945600:738:7) at HTMLUListElement.dispatch (jquery-1.9.1.js:3074:9) at HTMLUListElement.elemData.handle (jquery-1.9.1.js:2750:28) at Object.trigger (jquery-1.9.1.js:2986:12) at Object.jQuery.event.trigger (jquery.migrate.js:468:22) at HTMLUListElement.<anonymous> (jquery-1.9.1.js:3677:17) at Function.each (jquery-1.9.1.js:648:23)
When you try to manually enter the whispered buttons the send to chat hangs without letting you press enter and this error pops up in the console.  
1647106646
Andreas J.
Forum Champion
Sheet Author
Translator
Would an option been to store the command as an ability on a Macro Character , instead of embedding everything in the Chat Menu itself?
1647106703

Edited 1647106796
vÍnce
Pro
Sheet Author
I've experienced similar issues on the PF community sheet with nested quotes after the CSE update.  The sheet has whispered chat menus and there were single quotes around the character_name calls.  I had to include a substitute for the ampersand in the special character. ie "  I think roll20 made a later change when fixing marketplace quotes and I had to undo. lol  Anyway, not sure if it's pertinent to the is problem, but it might be something to look at.
Andreas J. said: Would an option been to store the command as an ability on a Macro Character , instead of embedding everything in the Chat Menu itself? This method also fails, and that macro I pasted above is actually a macro character ability.  The macro fails by just simply never firing the /w gm command everything else works.  And if you manually enter that /w command, even with the macro ability instead of the tokenmod command in the /w gm, it still gives that error in the consol and doesn't let you hit enter.  
1647114857
The Aaron
Roll20 Production Team
API Scripter
Great sleuthing. I'll see what I can do.