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: dorpond, trevor, Azhrei, Gamerdude

Post Reply
aRTy
Kobold
Posts: 4
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 to 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.

Impersonate the Lib:CleanProperties and open the "impersonated" window to have the buttons available. Use the selection to then target tokens.


Functions:
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 which are unticked by default. You can select between two modes at the top:
"Delete selected": Tick some properties and only delete those.
"Keep selected": Tick some properties and only keep those, deleting everything else.

When you confirm this checkbox list you will get a confirmation prompt stating your choice. It will list all the properties where you placed the tick in the previous step and tell you whether you are about to delete or keep those properties. It will also always tell you the number of properties that are about to get deleted, regardless of the mode (so either the number that you ticked to delete or the number that you did not tick to keep).

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.2.rptok
(173.66 KiB) Downloaded 48 times
Last edited by aRTy on Tue May 04, 2021 5:37 am, edited 3 times in total.

User avatar
digiacom
Cave Troll
Posts: 44
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: 12086
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!

aRTy
Kobold
Posts: 4
Joined: Sat Apr 21, 2012 7:10 am

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

Post by aRTy »

New version.

The checkbox list now comes unticked by default and you get a radio button selection for the mode. Placing ticks should be more intuitive than removing them and the explicit selection of the mode should also help make the UI clearer.
The confirmation prompt has been reworded accordingly and now tells you which properties you ticked before and which mode you chose.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

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

Post by wolph42 »

what ive done in the bot is do two input first ask the type of proces you like (all selected or not, and some other stuff) the second then shows all properties either selected or not. It varies from time to time which version is preferable!

Post Reply

Return to “User Creations”