Skip to content

Saved Rules

Save frequently-used operations for quick reuse across your vault.

Rules let you save combinations of file selection criteria and actions with a name, so you can run them repeatedly without re-entering the same criteria and actions each time.

What Are Rules?

A rule is simply a saved configuration containing:

  1. Rule Name - A descriptive name for easy identification
  2. Scope - Which files to process (vault, folder, or current file)
  3. File Selection Criteria (optional) - Which files match based on frontmatter
  4. Actions (required) - What changes to make

Saving a Rule

After entering your criteria and actions in the Rule Builder:

  1. Enter a descriptive Rule Name
  2. Click Save Rule
  3. The rule appears in the Saved Rules dropdown for future use

Loading a Saved Rule

  1. Open the Rule Builder
  2. Select a rule from the Saved Rules dropdown
  3. All fields populate automatically
  4. Click Preview or Apply

Example: Draft to Published

Rule Name: "Publish Draft Notes"

Scope: Entire Vault

File Selection Criteria:

status = "draft"

Actions:

SET status "published", SET published_date "{{today}}"

Save this rule once, then run it whenever you want to publish all draft notes.

Example: Archive Old Projects

Rule Name: "Archive Completed Projects"

Scope: Folder (projects/)

File Selection Criteria:

tags contains "project" AND status = "completed" AND completed_date < "2024-01-01"

Actions:

SET status "archived", FOR tags WHERE $ = "active" REMOVE, FOR tags APPEND "archived"

Managing Rules

  • New Rule - Creates a blank rule (clears all fields)
  • Delete Rule - Removes the currently selected saved rule
  • Overwrite - Save with the same name to update an existing rule

Best Practices

  1. Use descriptive names - "Publish Drafts" is clearer than "Rule 1"
  2. Preview first - Always preview before applying saved rules
  3. Test on a folder - Test saved rules on a small folder before running on entire vault
  4. One purpose per rule - Keep rules focused on a single task

See Examples for more saved rule patterns.

Released under the MIT License.