Run Script on Property Edit

by oneautumnmango
5
4
3
2
1
Score: 35/100

Description

This plugin has not been manually reviewed by Obsidian staff. Detects when YAML frontmatter properties are edited and runs supplied scripts.

Reviews

No reviews yet.

Stats

stars
downloads
0
forks
1
days
NaN
days
NaN
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
0
commits

Latest Version

Invalid date

Changelog

README file from

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%"
)