# class

## Synopsis

    class <string> {
      <class-spec>
    }

## Description

Declares a new class. Classes are used both for display and to control the behavior of the defragmenter (contrast this with display classes, which are only used for display and take precedence over ordinary classes for this purpose).

A typical class contains one or more match specifications, and a color specification. Classes may also contain sort order or priority specifications, as well as the locked and special flag attributes.

If a class contains more than one match specification, it will be matched if any one of its associated match specifications is matched.

Classes with no explicit priority specification are given a priority equal to the priority of the previously declared class plus one. It is strongly recommended that you avoid explicit priority specifications if possible; if you must use them, please start with a fairly high number (we suggest 1,000), to avoid interfering with built-in class definitions.

It is permissible to re-open an existing class definition, for instance to add additional match conditions or alter the sort order.

## Example

    // Match all applications files, coloring them yellow

    class "Applications" {
      match files where file is within "/Applications"
      color "#ffff00"
      sort on containing folder, name
    }

## See also

display class