
This was expanded from a short script by the Aaron when he created his gmnotes script. I added a lot of formatting and options. And then I had the Aaron check my work. Any errors however, are on my head.
This script pulls the contents from a token's GM Notes field. If the token represents a character, you can optionally pull in the Bio or GM notes from the character. It can also return graphics and tooltip info. The user can decide whether to whisper the notes to the GM or broadcast them to all players. There is an option to add a footer to notes whispered to the GM. This footer creates a chat button to give the option of sending the notes on to the players. Finally, you can direct the note either to chat, or to a named handout.
Images, API Command Buttons, Links and most special characters should pass through without issue. Images written in the markdown form of [x](imageURL) should parse correctly in both chat and handouts.
This script as written is optimized for the D&D 5th Edition by Roll20 sheet, but can be adapted for most common sheets using the Configuration command below.
This is now available for One-Click install, but if you want to install manually, CODE IS HERE
Commands:
!gmnote whispers the note to the GM
!pcnote sends the note to all players
Parameters
--token Pulls notes from the selected token's gm notes field. This is optional. If it is missing, the script assumes --token. This option does not require the token to have an associated character.
--charnote Pulls notes from the gm notes field of the character assigned to a token.
--bio Pulls notes from the bio field of the character assigned to a token.
--avatar Pulls image from the avatar field of the character assigned to a token.
--image Pulls first image from the bio field of the character assigned to a token, if any exists. Otherwise returns notice that no artwork is available
--images Pulls all images from the bio field of the character assigned to a token, if any exist. Otherwise returns notice that no artwork is available
--image[number] Pulls indexed image from the bio field of the character assigned to a token, if any exist. --image1 will pull the first image, --image2 the second and so on. Otherwise returns first image if available. If no images are available, returns notice that no artwork is available
--tooltip Pulls the tooltip from a selected token. This option does not require the token to have an associated character.
--tokenimage Pulls all the image from a selected token. This option does not require the token to have an associated character.
--notitle This option suppresses the title in the chat output. It is useful for times when the GM might wish to show an image or note to the player without clueing them in wha the note is about. For instance, they may wish to reveal an image of a monster without revealing its name. This parameter can be added to any command. It is the only paramater for which this is true. Example !pcnote --image --notitle will pull the first of any images from the token's associate character sheet and send it to the chat without a title. --notitle may be added to the command in any order.
--id supply this with a token id, and the script will attempt to read the notes associated with a specific token, or the character associate with that token. There is no space between --id and the token id. Only one token id may be passed.
--handout|Handout Name| If this is present in the arguments, the note will be sent to a handout instead of chat. This can allow a note to remain usable without scrolling through the chat. It can also be used as a sort of floating palette. Notes in handouts can be updated. Running the macro again will regenerate the note. The string in between pipes will be used as the name of the note handout. If no handout by that name exists, Supernotes will create one and post a link in chat to open it. The title must be placed between two pipes. --handout|My Handout| will work. --handout|My Handout will fail. A note handout automatically creates a horizontal rule at the top of the handout. Anything typed manually above that rule will be persistent. Supernotes will not overwrite this portion. You can use this area to create Journal Command Buttons to generate new notes or to give some context to the existing note. All updates are live.
--help Displays help.
--config Returns a configuration dialog box that allows you to set which sheet's roll template to use, and to toggle the 'Send to Players' footer.
Examples:
!pcnote --bio will send the contents of the selected characters bio to the chat for all players to see.
!gmnote --charnote will whisper the character's GMnotes to the GM
This script will work well with the following Stupid Tricks (and many more):
Invisible Tokens - The Notes Token (API version)
Invisible Tokens - The Control Token
Invisible Tokens - The Door Control
Chat Menus
Map Pins
Configuration
When first installed, Supernotes is configured for the default roll template. It will display a config dialog box at startup that will allow you to choose a roll template based on your character sheet of choice, as well as the option to toggle whether you want the 'Send to Players' footer button to appear.
You will need to edit the code of the script if you wish to create a custom configuration, or contact keithcurtis on the Roll20 forum and request an addition. The pre-installed sheets are:
Default Template, D&D 5th Edition by Roll20, 5e Shaped, Pathfinder by Roll20, Pathfinder Community, Pathfinder 2e by Roll20, Starfinder
For reference, here are the roll templates used for each sheet:
Default Template
const template = 'default';
const title = 'name';
const theText = ' ';
D&D 5th Edition by Roll20
const template = 'npcaction';
const title = 'rname';
const theText = 'description';
5e Shaped
const template = '5e-shaped';
const title = 'title'
const theText = 'text_big'
Pathfinder Community
const template = 'pf_generic';
const title = 'name'
const theText = 'description'
Pathfinder Official by Roll20
const template = 'npc';
const title = 'name'
const theText = 'descflag=1}} {{desc'
Pathfinder 2e by Roll20
const template = 'rolls';
const title = 'header'
const theText = 'notes_show=[[1]]}} {{notes'
Starfinder by Roll20
const template = 'sf_generic';
const title = 'title'
const theText = 'buttons0'
0.0.5 Expanded utility of "--image" parameter
0.0.6 Added auto-configuration for most popular sheets
0.0.7 Fixed for breaking of certain accented characters and diacriticals
0.0.8 Added --notitle parameter