Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Actions

Actions define what happens to files that match your filters. Each rule can have one or more actions that execute in order.

Available actions

actiondescription
moveMove files to a new location
copyCopy files with a new name in the same directory
renameRename files in place
deletePermanently delete files
trashMove files to system trash
logLog a message (for debugging/testing)

Action syntax

Actions are defined as a list under the actions key:

rules:
  - name: Example Rule
    locations: ~/Downloads
    actions:
      - move: ~/Documents
      - log: "Moved ${name}"

Multiple actions

Actions execute in order. This allows chaining operations:

actions:
  - copy: "${name}_backup${ext}"   # First, create a backup copy
  - move: ~/Documents              # Then, move the original
  - log: "Processed ${name}"

Template variables

Most actions support template variables in paths and messages:

variabledescription
${name}Filename without extension
${ext}File extension (with dot)
%YCurrent year (4 digits)
%mCurrent month (01-12)
%dCurrent day (01-31)
%HCurrent hour (00-23)
%MCurrent minute (00-59)
%SCurrent second (00-59)

See Templates for full details.

Conflict handling

Actions that create files (move, copy, rename) support conflict handling:

actions:
  - move:
      dest: ~/Documents
      on_conflict: skip  # Don't move if destination exists
modebehavior
rename_with_suffixAdd numeric suffix (file_2.txt, file_3.txt, etc.)
skipDon’t move/copy if destination exists
overwriteReplace existing file

Default is rename_with_suffix.

Dry run mode

Use --dry-run to preview actions without executing them:

autotidy run --dry-run