Dan, here are some thoughts that you can consider or ignore:
- Document KM Variables that must persist (not be deleted)
- The user of the macro needs to know which variables not to delete
- Consider using a prefix for all KM Variables that should not be deleted, so that they are easily identified by:
- Visual inspection in the KM Preferences > Variables tab
- Search by script
- For examle, I use "DND__". I know you don't like that prefix, and that's fine. Make one of your own design.
- A while back there was a lot of interest in how to cleanup unused Variables
- Here is one macro that does that: [KM] DELETE All Variables Except Those on Keep List
.
- In your scripts, document at the top which KM Variables are required and which are set (if any).