Deleting empty folders

Looks like indexing my files works the best for me in my workflow with DT. With that, there’s the occasional web or email file that gets “imported” in my database. I’ve noticed that, when deleting these files, there are empty folders left behind in the database (when you show packages). Is there an AppleScript that can delete those empty folders or does one have to get rid of them manually

One need not do anything. Let DEVONthink manage the internals of the database package - manually making any modifications to the database structure will have unintended consequences. If you delete a document or group from the user interface, and it’s gone from the interface after you empty the trash, then you’re done.