How to select folders containing a file starting with Delete

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? )