I saw the API script to import XML files generated by HeroLab into the Pathfinder character sheet. That's an excellent bit of work. However, for my purposes, the PF character sheet is way overkill. I'm playing a tabletop game, using roll20 locally (each player has a laptop), but I don't want to automate everything, just some basic rolls.
I got the great idea to take the XML generated by HeroLab and convert it to JSON (not very difficult, there are web sites that will do it handily). I tried reworking the macro, to do a JSON.parse to create a javascript object that represents the character, figuring accessing the various properties of the object would be faster than parsing the Xml by hand. I took the same approach and read the JSON from the gmnotes field, only to find that even after doing replaces for all the character entities (%20, %32, etc).
I started looking into it and found the problem. When I pasted the JSON text into the gmnotes field, it had several arrays defined with square bracket characters ( "[" and "]"). These characters get stripped out when I save the token after pasting the JSON to the gmnotes field.
Is there a reason that those characters get stripped?
I can come up with a workaround, but would prefer to just paste the json and have it work.
I got the great idea to take the XML generated by HeroLab and convert it to JSON (not very difficult, there are web sites that will do it handily). I tried reworking the macro, to do a JSON.parse to create a javascript object that represents the character, figuring accessing the various properties of the object would be faster than parsing the Xml by hand. I took the same approach and read the JSON from the gmnotes field, only to find that even after doing replaces for all the character entities (%20, %32, etc).
I started looking into it and found the problem. When I pasted the JSON text into the gmnotes field, it had several arrays defined with square bracket characters ( "[" and "]"). These characters get stripped out when I save the token after pasting the JSON to the gmnotes field.
Is there a reason that those characters get stripped?
I can come up with a workaround, but would prefer to just paste the json and have it work.