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.
Asked
Active
Viewed 233 times
2 Answers
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
-
So, if I can loop through every character, can I set it to exclude certain ones? That would be sufficient if so – Himitsu_no_Yami May 14 '20 at 00:04
-
@Himitsu_no_Yami sure but you can only filter based on available attributes. – Dale M May 14 '20 at 02:08
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