Using Patterns in Actions

For certain actions (including “Rename,” “Sort into subfolder,” “Add comment,” and “Display notification”), you must specify a pattern—a template of text and special attributes. The action uses your pattern to generate text when it runs. For example, when renaming a file, you can add the date the file was added. Since you don’t know what the date will be until the rule runs, and that the date varies from one file to the next, you can use an attribute in your pattern to represent that date. When the rule runs, it substitutes the actual date.

When you choose an action that requires a pattern, a popover appears as shown here. (Note that the available attributes vary from one action to another.)

Fill in the field at the top of this popover with the pattern you want. You can use a combination of plain text you type yourself (to include static elements as part of your pattern) and  tokens —blue bubbles representing any of numerous attributes of the file being matched. Using a token in your pattern tells the rule to substitute that item’s actual value when the action runs. To add a token to your pattern, either click it (once) or drag it to the desired position in the pattern. The “Example” field at the bottom of the popover shows a sample of how the pattern will look when the action runs (of course, the actual text will vary). When you’re finished editing your pattern, click “Done.”


Special Attributes

A few attributes have special behaviors when it comes to patterns:


Attribute Formatting

If you hover your pointer over any attribute after adding it to the field, you’ll see that an arrow appears on its right side. This indicates you can click the token to display a pop-up menu with more formatting options. Depending on the type of attribute, you may see one or more of the following options:

SEE ALSO

Using the Counter Attribute

Editing Date Patterns

Action Reference