Closed pdm-pcb closed 1 year ago
A couple of thoughts come to mind for this.
a replace[1, 1000]
should in theory replace all content from the first line up to the end of the file (if the file has 1000 or fewer lines).
The other idea I have is using a TemplaterJS script to modify the document directly and then firing it with a button. You can directly modify the files contents with this method...
check out this post on writing TemplaterJS scripts: https://publish.obsidian.md/shabegom/Publish/How+To+Use+Templater++JS+Scripts
Hey there! I'm cross-posting this with the Obsidian forum, because after giving it a day, I realized I just may not be using Buttons correctly. =) If this isn't suitable for an issue, feel free to close. Here's what I've got!
Hey all,
In most of my tasks, I've got front matter looking akin to:
I then use dataview to render tables of tasks with their various traits. It's quite nice!
I'd like to streamline things, though by being able to graphically update the status number. As it stands, I wind up needing to count to be sure in most cases, which is lame and slow. =)
So I wrote this little python script:
And put it into action with this here Buttons button:
It doesn't work quite, as it winds up appending everything. I tried using
replace [1,1000]
,replace [1,-1]
, andreplace [1,0]
but it seems like Buttons wants exact line numbers.So... thoughts? Is there a simpler way to graphically run a Templater command? Or maybe there's some way to run Templater commands via hotkeys?
I'm open to whatever solution. =) Thanks in advance!