Gauss said:
Kikanaide, Im really not sure what you mean by needing to magically know the character name. You should know the name. However, if you are using a generic macro that you want to auto-fill the name then as Dave stated, you can use @{selected|....} and @{target|....} to target character attributes, supply the name, etc.
Example: /roll 1d20+@{selected|Dexterity}
This will roll a 1d20 and add the dexterity attribute of the character sheet that has been assigned to the selected token.
Your pardon, Gauss. I meant to say that I can't find anywhere in the documentation that you can put math into attributes. Further, I can't find in the documentation that *have* to scope them by character, even though you're on a character's sheet already. Contrast this with abilities, where you don't have to scope unless you want to use something from a different character (or want to use /emas, but that's a separate gripe).
This piece of knowledge is what I referred to "magically" having to know. As you've said, you have the character name at hand - it's just not obvious that you need it. Admittedly, there is a helpful error message if you put syntactically correct reference to a non-scoped attribute (it at least lets you know it's looking for but not finding an attribute). But the lack of auto-fill as presented on the ability side both sends a message that you're doing something unintended and makes it less likely to arrive at a syntactically correct expression.
Dave W., the @selected workaround is decent, and is what I use in macros at present. Thank you for the suggestion, and it's likely what I'll use in attributes too. But like in macros and abilities, it can lead to remarkably strange behavior. @selected
for an attribute creates an attribute that only works as intended when called through a token action. It could produce incredibly odd behavior when called from a macro written for the macro bar or intended to be called directly from the character sheet. I've stated before that we should seriously consider unifying the way those three types of macros should be written. I consider this further evidence.
Just pause for a moment - why, on a character sheet, am I writing @{selected|____} to refer to that character's own attributes? Particularly when @selected can point to anyone?