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

Pulling Character name from new character sheet

I am trying to create an On/Off macro using the concentration API. I have it working but am having figuring out the code to pull name of selected character token.  Is it possible to pull a character name from the new character sheet in a macro?
1752340159
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Steve! Assuming by "the new sheet" you mean the D&D 5e (2024) Sheet, these will work for the character name: @{selected|character_name} @{selected|name} Other sheets may have different attribute names. This will retrieve the token name, regardless of sheet: @{selected|token_name}
Thank you Keith. Ill be more precise with the sheet name in the future.
1752359374
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
No worries. I usually assume that sheet by context, and the fact that folks usually identify the sheet for a less commonly-played game in the question. I just put that in to verify. I hope the answer worked for your needs.
1752369240

Edited 1752369253
GiGs
Pro
Sheet Author
API Scripter
This should work for all sheets @{selected|character_name}
1752419220
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
GiGs said: This should work for all sheets @{selected|character_name} Ah, is that a property of the character journal, rather than an attribute on the character sheet? In any case, I wasn't sure if it would work on a non-DnD Beacon sheet, such as Marvel.
Thank you both.  The posted script works great! @{selected|character_name}
1752428142
GiGs
Pro
Sheet Author
API Scripter
keithcurtis said: GiGs said: This should work for all sheets @{selected|character_name} Ah, is that a property of the character journal, rather than an attribute on the character sheet? In any case, I wasn't sure if it would work on a non-DnD Beacon sheet, such as Marvel. Yes, it's a property of the Journal. I am not 100% it will work for all Beacon sheets, since they are created very differently, but it works for all non-Beacon sheets.