I recently decided to consolidate my macros that refer to a character's gender by pronoun into a single one using attributes on the character sheet (ie subjective, objective, possessiveA, and possessiveP) and am looking for a way to loop through each character in a folder and add those attributes to each of them and set them to a default of {it, it, its, and its} respectively. Is there any way I can do that? I do have api access if it's required to do it.


You can’t

You can loop through every character with the API using filterObjs but [t]he API does not have access to the folder structure.

| improve this answer | |
  • \$\begingroup\$ So, if I can loop through every character, can I set it to exclude certain ones? That would be sufficient if so \$\endgroup\$ – Himitsu_no_Yami May 14 at 0:04
  • \$\begingroup\$ @Himitsu_no_Yami sure but you can only filter based on available attributes. \$\endgroup\$ – Dale M May 14 at 2:08

Not quite looping through a folder, but it does allow me to add attributes to specific characters simply by specifying a name/id or specifying that they're the currently selected token(s).

Using the ChatSetAttr API script I was able to set characters I had selected (and one I didn't have a token for but had a name for) to have the specific attributes I wanted.

For a default of {it, it, its, and its} I used the following macro to edit the ones I had selected:

!setattr --sel --subjective|'it'
!setattr --sel --objective|'it'
!setattr --sel --PossessiveA|'its'
!setattr --sel --PossessiveP|'its'

For the one I didn't have a token for I used the following to specify the correct pronouns.

!setattr --name Rilia --subjective|'she'
!setattr --name Rilia --objective|'her'
!setattr --name Rilia --PossessiveA|'her'
!setattr --name Rilia --PossessiveP|'hers'
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.