You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have grown REALLY fond of the scripting functionality of templater, and use that to automate quite a lot of mundane tasks.
For example, I keep a log of medicine taken in the frontmatter, but as an array. This gets cumbersome to edit, but a script solves that easily, and Templater is SUPER GREAT FOR THIS. You rock!
But right now in order to actually trigger the script, I need to (as far as I can tell) create a dummy templater note, that I can then trigger using the "Template Hotkeys" configuration.
So the script looks like this
asyncfunctionaddMedicine(tp){const{ type, dose, time }=await// .. tp.system.promt calls to get theseapp.fileManager.processFrontMatter(tp.config.target_file,metadata=>{constlog=metadata['medicine-log']||[];metadata['medicine-log']=[...log,{ type, dose, time }];})}module.exports=addMedicine;
Not I can create templates/add medicine.md
<%*
tp.user.addMedicine(tp)
-%>
And now I can add a hotkey to the templates/add medicine.md file.
This is SUPER COOL, and it solves my problems.
BUT if I didn't need to create this skeleton template to wrap the script, it would be even more awesome.
I tried searching for other Obsidian plugins that allowed me to run adhoc scripts, but I didn't find one. Don't know if I didn't look well enough. But many of the scripts are for creating contents, so having the affinity with templater is helpful for some tasks.
The text was updated successfully, but these errors were encountered:
stroiman
changed the title
Add "User Script Hotkeys", just like "Template hotkeys.
Add "User Script Hotkeys" in options, just like "Template hotkeys.
Mar 5, 2024
stroiman
changed the title
Add "User Script Hotkeys" in options, just like "Template hotkeys.
Add "User Script Hotkeys" in plugin settings, just like "Template hotkeys.
Mar 5, 2024
I have grown REALLY fond of the scripting functionality of templater, and use that to automate quite a lot of mundane tasks.
For example, I keep a log of medicine taken in the frontmatter, but as an array. This gets cumbersome to edit, but a script solves that easily, and Templater is SUPER GREAT FOR THIS. You rock!
But right now in order to actually trigger the script, I need to (as far as I can tell) create a dummy templater note, that I can then trigger using the "Template Hotkeys" configuration.
So the script looks like this
Not I can create
templates/add medicine.md
And now I can add a hotkey to the
templates/add medicine.md
file.This is SUPER COOL, and it solves my problems.
BUT if I didn't need to create this skeleton template to wrap the script, it would be even more awesome.
I tried searching for other Obsidian plugins that allowed me to run adhoc scripts, but I didn't find one. Don't know if I didn't look well enough. But many of the scripts are for creating contents, so having the affinity with templater is helpful for some tasks.
The text was updated successfully, but these errors were encountered: