Rules & workflows · 6 MIN READ

How to Create Automatic File Sorting Rules for Names, Types, Sizes, and Dates

Learn AND, OR, nested groups, rule priority, and rename templates with practical examples.

A useful sorting rule turns a decision you repeat into a clear instruction. Instead of repeatedly finding invoice PDFs and dragging them into the same folder, describe what those files have in common and where they belong. FileJuggler.online offers a visual WHEN and THEN editor so that the logic stays readable without writing scripts.

Rules run locally against metadata from the folder you selected. They cannot inspect document text, run shell commands, or monitor the disk after the page closes. You still generate a preview and explicitly approve the resulting changes before execution.

Begin with one concrete example

Choose a small set of files whose desired destination is obvious. For example, imagine invoice-104.pdf, invoice-105.pdf, and meeting-notes.pdf in Downloads. Your first rule could match extension PDF and filename containing invoice, then move matching files to Documents/Invoices. The meeting notes should remain outside that match.

Starting with a known example makes it easier to check the logic. Avoid beginning with a rule so broad that nearly everything matches. Once the first rule behaves correctly in preview, add another case or a broader fallback. Give each rule a descriptive name so the preview can explain why an action was planned.

Choose the metadata field deliberately

Filename conditions include equality, inequality, contains, does not contain, starts with, and ends with. Extension conditions support individual formats or comma-separated lists. Path conditions can match a parent folder or text within a relative path. These are useful when filenames alone do not carry enough project context.

Size conditions compare bytes using B, KB, MB, or GB inputs. Modified date conditions can match an age in days or a date boundary. The date comes from last modified metadata, not a guaranteed creation, download, or photograph date. A file copied by another program may therefore have dates that differ from your expectations.

Use AND when every condition matters

An AND group matches only when all its conditions are true. Extension PDF AND filename contains invoice is narrower than either condition alone. This helps avoid sending an image named invoice-preview.png into a document folder or moving an unrelated report.pdf just because it is a PDF.

Think through an example that should match and another that should not. If a rule is unexpectedly broad, it may need another condition. If nothing matches, check spelling, units, dates, and whether the relationship should really be AND. The preview gives you evidence without changing the files.

Use OR and nested groups for alternatives

An OR group matches when any condition is true. For example, filename contains invoice OR filename contains receipt can describe two useful naming patterns. However, adding extension PDF into that same OR group would match every PDF, not just financial documents. Logical grouping changes the meaning of the rule.

Use nesting to express PDF AND either invoice OR receipt. The outer AND group contains the extension condition and an inner OR group for the two filename alternatives. Keep groups shallow enough that you can read them aloud. Several simple rules may be easier to maintain than one deeply nested rule with many exceptions.

Pick an action that matches your intention

Move sends the file to a destination and removes the original only after a verified copy succeeds. Copy leaves the original in place. Rename changes the filename at its current planned location. Create folder ensures a destination directory exists, while Move to FileJuggler Trash keeps unwanted files in a reviewable folder instead of permanently deleting them.

Destinations are relative to the folder you selected. Documents/Invoices is valid; a path reaching outside the selected scope is not. The editor validates imported rules and rejects unsafe path structures. A folder name should describe its purpose clearly enough that you will understand it when browsing outside the web app.

Build rename patterns carefully

Rename templates can combine the original name, extension, current date, modified date, parent folder, and a sequence number. A pattern such as Screenshot-{modifiedYear}-{modifiedMonth}-{sequence}.{extension} creates a readable sequence while preserving the original suffix. Actual names appear in the preview before execution.

Keep the extension variable when the format should remain recognizable. Changing a suffix does not convert the content. Sequence values follow the deterministic file ordering used for the scan and plan, so treat them as session labels rather than permanent identifiers. Invalid filename characters are sanitized for common operating system compatibility.

Set priority and stop behavior

Rules are evaluated from top to bottom. Place an Invoice PDFs rule above an All PDFs rule. If Stop after this rule matches is enabled on the invoice rule, matching invoices finish there. Otherwise, later matching rules may add additional actions for the same file. The resulting plan should make that chain visible.

Multiple actions can be intentional: copy a file into a backup folder, then move the working copy into a project destination. But complexity increases the need to review the whole sequence. If one step fails, later dependent actions for that file should not proceed as though it succeeded. Check the activity log after execution for those cases.

Validate with a preview, not a guess

Generate Preview changes after adding or changing rules. Search for your known matching file and your known nonmatching file. Filter for renames, copies, unchanged entries, and conflicts. Read the destination column rather than relying only on the count of affected files; a correct count can still point to the wrong folder.

Keep both handles name collisions by finding a numbered destination. Skip existing leaves conflicts untouched. Replace existing is an explicit choice with limited recovery: overwritten destination contents are not retained by session undo. A good rule determines where files belong, while a conflict policy determines what happens if that place is occupied.

Save a workflow you can explain later

Custom rules are stored in local browser storage, alongside small preferences. Export JSON for a portable backup or to transfer the workflow to another browser. Imported rules are validated, but you should still read them and generate a preview against your own folder before applying them.

Review rules when your naming conventions change. Remove redundant cases and keep narrow exceptions above broad fallbacks. The best automation is not necessarily the longest rule list; it is a set of decisions you understand well enough to trust after checking a fresh preview.

A LITTLE CLARITY

Good questions. Straight answers.

Can a rule match text inside a document?+

No. V1 rules use filenames, extensions, sizes, modified dates, and relative paths. They do not parse PDF, Word, or spreadsheet contents.

What does Stop after this rule matches do?+

It prevents later rules from adding actions for that matched file. It is useful when a specific rule should take priority over a broad fallback.

Can rules use Windows creation dates?+

No. Browser metadata reliably provides last modified time for this workflow. Creation-time conditions are not offered because that information is not consistently available.

Do exported rules include my files?+

No. A rule export contains serializable rule definitions. It does not include file contents, folder handles, or a saved scan of your local directory.