For macOS 10.15 and later only. This script will list the empty user-created playlists in the Music app and can delete all or just a selection of them.
NOTE: A bug in the current version of Music prevents the complete removal of playlists from the Sidebar UI (when they are deleted via an AppleScript like this one) until the Music app has been quit and re-started.
- Accommodations for macOS 11 Big Sur
- Performance, UI and security enhancements