5

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.

Himitsu_no_Yami
  • 6,283
  • 4
  • 31
  • 89

2 Answers2

3

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.

Dale M
  • 210,673
  • 42
  • 528
  • 889
1

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'
Himitsu_no_Yami
  • 6,283
  • 4
  • 31
  • 89