Button to delete filtered directories

I have a button to delete all filtered files from the current directory.

Delete * FILTER ".~tmp" (suggestion by Leo from another post)

I would like to add to this button a similar function for directories, however I don't fully understand the suggested "code"

  1. When I look at the DOpus reference I see something like:

Delete /m ".~tmp"

  1. Should I assume the * between Delete and FILTER means FILTER ".~tmp" will delete only one file and the * makes it continue matching files until there are no more.

  2. Should I assume to delete directories I only need to specify a filter to match the name?

to delete directories tempone, temptwo, tempthree

Delete * FILTER "temp*"

Thanks

John

Delete * is shorthand for Delete FILE=* (since FILE is the default argument, it doesn't need to be explicitly named.)

Delete on its own will delete whichever items are selected.

Delete with a filename or path given to it will only delete that thing (and anything below it), and ignores the selection entirely.

You can also pass wildcards.

So Delete * will delete everything below the current directory.

You can then also apply a (recursive) filter on top of that, either as a named filter (defined in Preferences or the Find Files window), or as a simple wildcard. If a simple wildcard is used for the filter, it only affects which files are deleted; all folders are always deleted unless they contain a file which isn't deleted.

As always, test these things in a dummy folder in case they don't work the way you think they do. Be particularly careful with the top-level items and whether or not the filter

Delete * FILTER ".~tmp" would delete all files named .~tmp in and below the current directory.

1 Like