This script is in early alpha! Backup and version control your Obsidian files before attempting to run this script.
(First time poster.)
I’ve made a nifty little script which automatically fills out the created_date
field in YAML metadata.
The main goal is if all the folder’s metadata is wiped, you’ll still have it in the YAML.
Here’s the link.
Could I get some feedback?
I plan on adding file_name
and modified_date
[1] fields as well.
[1]: Edit: modified_date
is being worked on. modified_date
is in the mostly complete stage.
2 Likes
got error here.
❯ python3 obsidian-metadata-handler/created.py -p "./test-vault"
test-vault/A file.md
Traceback (most recent call last):
File "/Users/gaofeng/Code/opensource/obsidian-metadata-handler/obsidian-metadata-handler/created.py", line 30, in <module>
if file["modified_date"] == True:
File "/usr/local/lib/python3.9/site-packages/frontmatter/__init__.py", line 275, in __getitem__
return self.metadata[name]
KeyError: 'modified_date'
Thanks for reporting the error, @lifesign!
I’ve gone ahead and logged the error on GitHub. Can we continue discussion there to avoid thread clutter?
Why not write it as a plugin?
As of today, this script has been deprecated. Please find alternatives, as support and stability is no longer guaranteed.