# Editing filters

## The Filters window

You can edit filters in the "Filters" window, accessible from the GrandPerspective menu. GrandPerspective comes with a few default filters. You can create your own filters using the New button, or modify existing filters using the Edit button. In both cases, a new "Filter" window will appear where you can edit the filter. Filters that you create or modify are maintained in the filter repository, which is automatically stored in your preferences. That way they are available next time you run GrandPerspective.

You can remove filters that you created, using the Remove button. You can also use this button to undo changes you have made to the default application-provided filters. The filter will then be replaced by the original filter with this name.

## The Filter window

Configuring a specific filter is done in a "Filter" window. The window contains two lists. The list at the left shows the tests that are to be used in the filter. The list at the right shows all tests that are still available. You can select tests that should be used by moving them from the right to the left, using the < button.

An icon to the left of each test in the filter indicates if the test is inverted or not:

  items that pass the test are selected
  items that pass the text are excluded

You can toggle between both states by double-clicking on the test. Some tests cannot be toggled. This holds for tests for which there is only one sensible state. Tests that apply to folders are always inverted. If they were not, a file would only pass the test when all folders in its path (starting from the folder that was scanned) pass the test. In practice, this is not what you want, as typically no files will pass the test.

When there is more than one test in the filter, the selection logic is as follows:

- If there are one or more tests with a green checkmark, a file only needs to match one of these
- If there are one or more tests with a red cross, a file should not match any of these

GrandPerspective comes with a few default filter tests. You can create your own tests using the New button, or modify existing tests using the Edit button. In both cases, a new "Filter test" window will appear where you can edit the test. Tests that you create or modify are maintained in the filter test repository, which is automatically stored in your preferences. That way they are available next time you run GrandPerspective.

You can remove tests that you created, using the Remove button. You can also use this button to undo changes you have made to the default application-provided tests. The test will then be replaced by the original test with this name.

## See also

- Editing filter tests