Rules - FreakySneaky787/Simple-Organizer GitHub Wiki

Rules

Rules send files to a folder of your choice before the normal sorting by extension. They are checked from top to bottom; the first matching enabled rule wins.

Creating a rule

Rules tab โ†’ Add rule, then fill in:

Field Example
Name Invoices
Conditions one or more conditions (below) โ€” all of them must match
Target folder Invoices or Work/Reports
Enabled on / off

Add condition adds another condition (up to 5); the ร— next to a condition removes it. Example: extension = pdf and older_than_days = 365 sends only PDFs that are older than a year.

Conditions

Condition Value example Matches
extension pdf, tar.gz Files with that extension (multi-part extensions work). .pdf and *.pdf mean the same; one extension per rule
name_pattern invoice_*.pdf, *.log Wildcard match on the file name, case-insensitive
min_size_mb 100 Files of at least 100 MB
max_size_mb 10 Files of at most 10 MB
older_than_days 365 Not modified for at least a year
newer_than_days 7 Modified in the last week

Sizes and days must be zero or positive numbers.

Target folder

The target is always a folder inside the scanned folder. Sub-folders like Work/Reports are allowed. Not allowed:

  • absolute paths, drive letters, ..
  • the characters < > : " | ? *
  • reserved Windows names like CON, NUL, COM1
  • names ending with a dot or a space

A rule whose target is not allowed (e.g. from a hand-edited rules.json), or points outside the scanned folder through a link, is ignored during the scan with a warning in the log.

Managing rules

  • Click the dot in the first column to switch a rule on or off (or select it and press Space).
  • Double-click a rule (or Edit) to change it.
  • โ†‘ / โ†“ change the order โ€” remember, the first match wins.
  • Delete removes a rule after a confirmation.
  • Changing rules clears a preview that was made with the old rules โ€” scan again.

Rules do not use sub-categories: a rule's target folder is used as it is.

Examples

Goal Condition Value Target
Keep invoices together name_pattern *invoice* Invoices
Big files somewhere separate min_size_mb 500 Large files
Archive what is older than a year older_than_days 365 Archive
Archive old PDFs only extension + older_than_days pdf + 365 Archive
Logs into one folder extension log Logs

Where rules are stored

In rules.json โ€” see Data and Settings. Further conditions are stored in more_conditions (only for rules that have them). Versions 3.4.1 โ€“ 3.4.5 ignore them, so a rule with several conditions would match more files there; 3.4.0 and older cannot read such a file at all. If the file cannot be read for a moment (e.g. locked by a sync client), scans stop with a message instead of sorting without your rules. The file is read as UTF-8 (a byte order mark, as Notepad or PowerShell may write it, is fine). A damaged file โ€” not valid JSON, or saved in another encoding โ€” is backed up to rules_corrupt_<time>.json; if even that is impossible, the Rules tab refuses to save so the file is never overwritten.

โš ๏ธ **GitHub.com Fallback** โš ๏ธ