How to select folders containing a file starting with Delete

I would like to select -folders- when they contain a file that starts with a certain string.
In my case the word Delete. I have added the word Delete to the name of 1 file and the entire folder should be deleted.
All these sub folders are within 1 parent folder.

I can perform a find file action, no problem, but want to delete all the sub folders containing these 'to be deleted files', i.e. a file name that starts with Delete.

Is there an easy way to do this?

thanks.

At the moment, matching folders based on the contents/files below them requires scripting and is a bit fiddly. It's possible, but there's probably an easier solution for this particular case.

It's easy to find all the Delete* files, so the question then becomes how to delete their parent folders. Two simple ways to do that:

  • After finding the Delete* files, select them all, then right-click and choose the option to open their containing folders in new tabs. Then, in each tab, go up a level and delete that folder.

  • Or, better if there are a lot of folders to delete, you could make a button which runs this command:

    Delete {filepath|..}

    That will delete the parents of all selected files. So you could select all the found Delete* files and then click that button to delete the folders that contain them.

(Based on this old thread: How to find a folder that contains an item? )

Many thanks indeed. Yes, it is quite a number of folders. I'll check out the 2nd option.

BTW...,
I just thought the following possible workaround.
Something I believe is not (yet) available within Opus is to change a folder modified date after oldest/newest date in that folder.
In flat view/show files only I could filter the files on 'delete', select them all, change the create/modified date on whatever old date - January 1950 or something.
Then have the folder modified date changed after oldest date, so, to 01-01-1950, sort folders on date and delete them.

A tool like SetFolDate can do this or a script as in

Anyway, thanks again.