While I admire the work on this macro I have taken a different approach. Using the Mac's native Automator app I was able to create this process with four simple steps:
- Get Specified Finder Item (navigate to the folder that you want to scan - you can repeat this step with multiple folders).
- Get Folder Contents.
- Filter Finder Names (using the Date Created option).
- Move Finder Items to Trash.
I added a notification step at the end (Display Notification) so that I'd get an alert when it runs. I then just set up a timed trigger (you can set up multiple triggers if you prefer) and use the "Execute" Action Item.
My logic is that the native app Automator is more reliable, runs faster and is just easier to build. Using KM to trigger it is better than making it a Calendar Item, which I have always found to be unreliable.
Just my 2 cents.