Run Script on Property Edit

pending

by David Whittam

Detects when YAML frontmatter properties are edited and runs supplied scripts.

3 starsUpdated 3mo agoGPL-3.0Discovered via Obsidian Unofficial Plugins
View on GitHub

Run Script on Property Edit

An Obsidian plugin that detects when YAML frontmatter properties are edited and automatically runs specified scripts.

Usage

  1. Go to Settings → Community Plugins → Run Script on Property Edit
  2. Click "Add new property rule"
  3. Configure your rule:
    • Property name: The frontmatter property to watch (e.g., status, closed, tags)
    • Script path: Full path to your script (e.g., C:\Scripts\my-script.bat or /usr/local/bin/my-script.sh) (haven't tested with a .sh)
    • Show notification: Toggle to show a notification when the script runs
  4. Enable the rule
  5. Edit the property in any note's frontmatter to trigger the script

Environment Variables

Your script receives these environment variables:

  • PROPERTY_NAME - Name of the edited property
  • PROPERTY_VALUE - New value of the property
  • PREVIOUS_VALUE - Previous value of the property (this will be blank unless changed previously in the same obsidian instance)
  • FILE_PATH - Path to the file (relative to vault)
  • FILE_NAME - Name of the file
  • VAULT_PATH - Full path to the vault

Example

Watch for a closed property and move the file when set to true:

@echo off
if /I "%PROPERTY_VALUE%"=="true" (
    move "%VAULT_PATH%\%FILE_PATH%" "C:\Archive\%FILE_NAME%"
)

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.