
Hola, I don't know how usefully this will be for anyone else, but I started working on a table sorting script for rollable tables. I have gotten pretty far in terms of error handling but I would really appreciate some help trying to break this thing. If you would like to, please do so in a copy of a game or test environment. I cannot stress enough how much I do not recommend testing this in a game that you do not want potential data loss. Also, in an effort to keep the commands congruent with a lot of Aaron's scripts I have used similar input handling and shamelessly recycled the entire switch from one of his scripts (as always, thank you Aaron). DISCLAIMER: This script deletes and renames tables during the process. Install at your own risk. This is very much a WIP. I am attempting to make sure the delete command cannot function accidentally. Here is how the chat commands would typically go: "!sort-tables --tag" : this will rename all current tables with a leading !SRC! tag (e.g. "Wild-Magic" becomes "!SRC!Wild-Magic" "!sort-tables --create": this creates new JS objects from any table that was tagged, sorts them, then creates Roll20 objects in that order and tags them with a leading "!SORTED!" tag (e.g. new table is created title "!SORTED!Wild-Magic". "!sort-tables --delete" "--source": this deletes all tables tagged with "!SRC!". This process will be cancelled if the number of source tagged tables equals the amount of tables in the game (i.e. you cannot delete tables if the end result would be no tables left in the game). This is an effort to prevent the delete action from being used before the new tables are created. "--sorted": same thing but deletes tables tagged with "!SORTED!" "!sort-tables --remove" " --sorted": this removes all "!SORTED!" tags from the leftover tables. You cannot perform this command unless there are two sets of matching tables where one set is tagged with source and the other tagged with sorted. You can override this by adding "--force" to the end of the command. This is to prevent tags being removed without confirmation from the user since it will prevent the sorted tables from being deleted if there happened to be an error. "--source": same thing but for tables tagged with "!SRC!" If you have any ideas/criticisms/improvements I am very interested in hearing them. If the tagging could be handled better, the error handling, etc. I am by no means a professional and am super prone to tunnel visioning after staring at this for so long. So please break this thing in a safe, testing envrionment. Right now, the script is intended to only sort tables alphabetically. I would love to expand the functionality of that to sort by other parameters or even group tables based on whether or not they have avatar items so that token tables can by grouped separately from regular rollable tables. Before I can do that though, I want to make this thing as bulletproof as possible so that it doesn't cause irreparable damage. For that reason, I also won't be submitting this script to One-Click so it will need to be manually installed. You can find the script here: <a href="https://github.com/JWCaiola/TableSorting/blob/master/TableSorting.js" rel="nofollow">https://github.com/JWCaiola/TableSorting/blob/master/TableSorting.js</a>