Thanks a lot!
Maybe you should post a topic about your plugin somewhere in the forum to advertise it
Thanks a lot!
Maybe you should post a topic about your plugin somewhere in the forum to advertise it
I have a question, I had created and used the following Templater script based on this thread.
<%*
setTimeout(() => {
app.fileManager.processFrontMatter(tp.config.target_file, frontmatter => {
if (!frontmatter['created']){
frontmatter['created'] = tp.file.creation_date('YYYY-MM-DD');
}
if (!frontmatter['modified']){
frontmatter['modified'] = tp.file.last_modified_date('YYYY-MM-DD');
} else {
frontmatter['modified'] = tp.date.now('YYYY-MM-DD');
}
if (!frontmatter['tags']){
frontmatter['tags'] = null;
}
if(!frontmatter['file_type']){
frontmatter['file_type']=null;
}
});
}, 200)
-%>
ļ¼This script creates some properties if they do not exist in the note, and for the created and modified properties, it either gets the date from the system or changes it to todayās date.ļ¼
It worked fine until yesterday, but today I noticed that when I apply this script to a note where no properties exist, it outputs plain text without any ---
, as shown below, and no properties are created.
created: 2024-02-15
modified: 2024-02-15
tags:
file_type:
For notes that have at least one property, I am still getting the expected behavior.
As far as I have tried, the script works correctly in Obsidian v1.5.4, and appears to have the above problem in Obsidian v1.5.5.
I have looked in Obsidianās Changelog, but could not find anything that might be related. I have looked in Obsidianās Changelog and could not find anything that might be related to this.
If anyone knows the cause, please let me know.
Iām not using processFrontMatter
in my templates, but it would be strange that it worked until 1.5.5
I canāt help fix this, but thought Iād offer up a gem as a way to deal with your date stamping: Update time on edit plugin
@iiz @gregp Apologies this did seem to get broken in the last update due to an internal refactor. I have a fix ready that will ship in the next build.
Iām also hoping the app.fileManager.processFrontMatter
function will never be changed as many many peopleās workflow depend on it and regulars and other frequent posters keep mentioning this method for property updates.
Cheers
Good to hear it! I will wait for the update.
Thanks for the info! Iāve recently started using properties, so Iām using the above script for the purpose of adding properties to the original notes, but I may automate it in the future.
Thank you so much. We really appreciate it
For anyone coming from Google, thereās now a plugin which does this all automatically and updates dynamically every time the note is modified. Search for " Last Modified Timestamp in Status Bar" in the community plugins.
obsidian://show-plugin?id=last-modified-timestamp-in-status-bar