I'm trying to create an automator workflow or application that, when activated, deletes all the files and subfolders in my Downloads folder that have not been created, modified, added, opened, or accessed in any way in the last 30 days.
I tried filtering like this:
But that doesn't really do the job like I want it. First of all, there's no option to filter by "date added", which I would really like. Secondly, I would prefer it to prioritize a subfolder over that subfolder's contents. For example, I have a folder which I added today, but the file inside that folder has a "date added" of much longer ago. My preference would be that that folder, including its contents, are ignored and therefor not deleted.
Then I read in another Stack Overflow thread (or it was at least some Stack Exchange site) that someone recommended to use a bash script instead. Something like this for example:
$ find "$HOME/Downloads" -type fd -mtime +30d -atime +30d -iname '*.*'
But even that doesn't seem to filter out the exact items that I want to filter out.
So just to be clear, I want to delete everything in my Downloads folder that has not been added, opened, created or modified in the last 30 days. And if there's any subtree where any of the folders or files within that subtree has been added, opened, created or modified within the last 30 days, then I would like that entire subtree to be ignored and left alone. Can anyone help me out here?

