Delete FILE="~(*{dlgstring|Enter string to exclude:}*)"
I would be very careful using that, though. If you type the wrong thing, it won't be easy to tell what it's about to delete.
(De)Selecting and/or hiding the unmatched files, then deleting as a separate step after visually checking they're the right ones, would be much safer, and what I would do instead.
So I was thinking of using Directory Opus' search bar to filter out excluded files/folders. But I don't know what search syntax to use.
For example...how can I exclude any files/folders that contain "snag" or "pull" in their names?
Note that I want to exclude files/folders that have "snag" or "pull" anywhere in their file names.
For example, a file like "thesnagit.txt" or a folder named "thepulleymachine" should be excluded because they contain the excluded text in-between their names.
Hi @Leo, while I greatly appreciate the code...I don't think I'll be able to remember and type it out.
But I stumbled across another solution - which I need your help accessing in a faster manner.
So I was playing with the advanced 'Find' (Ctrl+F) panel. By using the "Advanced" tab, I was able to get the exclusions I want.
Now I know you can press 'Save' and call it back up using the "Filter" dropdown.
However, is there a way I can create a toolbar button that calls up this 'Find' panel and automatically loads my "search filter"? And furthermore if it's not too much trouble...when pressing that toolbar button I don't want the actual "Find" search action initiated. It should just show the panel with the search filter loaded...that way I can edit the search terms in the Find box.
Obviously, this template-text gets replaced with whatever text I require for that task. Once my task is complete, I close the Find panel.
The problem is that the next time I use my custom toolbar button to load the Find panel and search filter...it shows me my last search (instead of the template-text):
Notice the word "modified" next to my search filter "Find-Exclude". If I go to the drop-down and click on my filter again...it resets back to the original desired settings and template-text.
But I don't want to have to manually do this every time. Is there a way I can prevent the "Find" panel from remembering the previous search? Maybe something via settings or the changes to the button code?
Thank you @lxp and @Leo for the ultimate solution and pushing me in the right direction!
The final code provided by @lxp solves the problem I mentioned earlier. And this is the most noob-friendly method to accomplish what I originally asked for in my original post.
Though @Leo...I noticed the 'Find > Advanced' tool seems hard-coded to include file extensions in the search. When I asked ChatGPT if that behavior could be disabled, the only solution it offered was to use some convoluted "Regular Expression" that I could not understand...and is not really convenient to implement in my use-case.
If possible, I hope the Directory Opus team could include a checkbox option to "ignore file extension". To be clear, I'm referring to the area where you have the three existing checkboxes "Case sensitive", "regular expression", "wildcard".