Settings – Filtering

A BetterZip filter is a saved set of rules that matches files by name, path, kind, size, or modification date: the same kind of structured query Finder uses for Smart Folders. A filter either keeps only what it matches or leaves out what it matches. The Filtering tab is where you build, name, and store those filters so they’re available everywhere BetterZip can filter: the “Delete with filter” function, adding files to an archive, and the filter picked in save and extract presets.

For how filtering is applied to an archive once you’ve defined it, see Filtering Files.

The Filter List

The tab is a single table listing every saved filter by name. Buttons below the table:

  • + (or ⌘N): opens the filter editor sheet titled Create Filter to define a new one.
  • – (or ⌫): removes the selected filter.
  • Edit (pencil icon): opens the editor sheet on the selected filter. Double-clicking a row does the same.
  • Restore Defaults (right side): brings back the bundled factory filters (the Mac-stuff cleaner, etc.) without touching filters you’ve added.

The Filter Editor

The editor sheet reads as one sentence, top to bottom, under the Define the filter criteria: heading.

It starts with the direction: Keep only or Leave out the items the rules match. Write the rules for what you have in mind – Name ends with .md – and let the pop-up decide what happens to them, rather than writing the opposite of what you want.

Below it sits the rule builder with one or more rows. Each row has three or four pop-ups; click the + at the right edge of any row to add another, the – to remove it. Rows are grouped under All of, Any of, or None of, and groups can be nested to build AND/OR logic.

Each rule starts with the attribute you want to match against:

  • Name, Path, Kind: text comparisons. Choose from is, is not, contains, begins with, ends with, is like (shell-style glob with * and ?), and matches regex (full regular expressions). Text matching is case- and diacritic-insensitive.
  • Size: numeric comparisons (is, is not, is less than, is greater than, is at most, is at least) with a trailing popup to pick the unit: bytes, KB, MB, or GB.
  • Date Modified: either an absolute date comparison against a date picker, or a relative window (within the last N days/weeks/months/years) chosen from the trailing unit popup.

Under the rules is the option Leave out folders that end up without any file, and below that a line describing in words what the filter will do – to the items, and to the folders around them. Both update as you edit. At the bottom you name the filter; that name is what appears in the Settings list and in every filter pop-up throughout the app. Click OK to save, Cancel to discard.

Rules and folders

Because removing a folder removes everything inside it, a filter is only allowed to do that when it clearly means to:

  • A Keep only filter never removes a folder – the files it keeps live inside those folders, so the structure survives.
  • A Leave out filter removes a folder that matches on name, path, or kind, together with its contents.
  • Size and Date Modified rules never apply to folders, whichever direction the filter runs in. A folder’s own size and date say nothing about the files in it.

Where Saved Filters Show Up

Once saved, a filter is available everywhere BetterZip filters:

  • The Delete with Filter sheet, where a saved filter can be loaded from the gear menu as a starting point.
  • The Filter pop-up in save presets: matching items are kept or left out while writing the archive.
  • The Filter pop-up in extract presets: the same while extracting.