CleanProperties: A tool to selectively mass delete token properties

Show off your RPG maps, campaigns, and tokens. Share your gaming experiences and stories under General Discussion and save this forum for things you've created that may help others run their own games. Use the subforums when appropriate.

Moderators: Azhrei, dorpond, trevor, Gamerdude

Post Reply
aRTy
Kobold
Posts: 3
Joined: Sat Apr 21, 2012 7:10 am

CleanProperties: A tool to selectively mass delete token properties

Post by aRTy »

Please note:
If you are handling tokens with important data on them, save a backup before using this tool be on the safe side.


This library token comes with seven buttons to use. Most features can be used on both a single selected token as well as a group of selected tokens.

1) list all properties
Simply outputs all properties of a token into chat as a comma separated list and tells you the quantity. This includes properties that are not defined in campaign properties and are consequently hidden unless explicitly queried.

2) delete all properties without a prompt
Essentially factory-resets a token's properties. No special checks in place and you won't get any confirmation prompt.

3) delete selected properties
All properties will be presented to you in a list with checkboxes. You can choose which ones to delete and which ones to keep. All checkboxes come ticked by default and by default this means getting marked for deletion. You can tick a special box at the top to invert the method so that checked properties are kept and only the few ones manually unchecked get deleted.
After you confirm this checkbox list you will get a confirmation prompt stating your choice as briefly and clearly as possible. It will list all the properties where you modified the tick in the previous step and tell you – depending on the method – that all properties except those or only those properties will be deleted.

4) save target's properties as desired
This is the only function that requires exactly one selected token. A list of this token's properties will be saved to Lib:CleanProperties and will be considered as "desired". This serves as a filter for the next three features.

5) list undesired properties
Like (1), but all "desired" properties are filtered out.

6) delete undesired properties without a prompt
Like (2), but all "desired" properties are filtered out. The main use of this feature is to delete all outdated properties on tokens with little effort. Just save the properties of a clean new token (with the correct campaign property set) as desired. See also "Notes (a)".

7) delete selected undesired properties
Like (3), but all "desired" properties are filtered out. Use this when you need more precision and scrutiny than (6) offers.


Notes:
a) If you delete token properties with this tool then those properties will be undefined for the time being, much like when you drag a picture from the resource library and make a token out of it. All macros that use these properties will read the default value from campaign properties. The CleanProperties tool (and macros that use similar property queries) will act as if the properties don't exist at all though. This means deleting all properties with (2) and using list all (1) right afterwards will tell you "No properties defined on this token". You also can't immediately save this clean state as desired with (4). Once you open the "Edit Token" window (double click) and confirm it with "ok" all default properties will exist on the token again (based on the campaign property type you've selected in the "Config" tab of the token).

b) The checkbox lists by functions (3) and (7) can be heavy on performance if your token holds an immense amount of properties. For reference, a token with roughly 3000 properties caused a loading time of ~2.5 seconds for the checkbox window and about 1 second each for the confirmation window and the deletion process.
Attachments
CleanProperties_v1.1.rptok
(80 KiB) Downloaded 15 times

digiacom
Cave Troll
Posts: 31
Joined: Thu Sep 27, 2018 3:00 am

Re: CleanProperties: A tool to selectively mass delete token properties

Post by digiacom »

Handy and clear. I can't count how many times I've written little macros to do just this, so grateful to have it organized and collected :)

The only feature I would like is a set of functions to identify/remove 'unlisted' properties that the token has; that is, properties that aren't in the property set defined on the token ("Basic" being the default). That said, the 'Desired' property system is pretty strong and I will use that for now. :)

Dropped it into my campaign to clean up player tokens immediately!
a.k.a. Melek on Discord.
Check out my Simple 5e Framework!

User avatar
Azhrei
Site Admin
Posts: 12050
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: CleanProperties: A tool to selectively mass delete token properties

Post by Azhrei »

+1

Agreed! I'm grabbing this right now as well.

And while the "desired properties" feature will suffice, I think having a list of "unapproved properties" (meaning those not in the token's current Property Type) would be a big benefit.

Thanks for sharing!

Post Reply

Return to “User Creations”