I currently have a process for clipping some Reddit posts and storing them in Obsidian. In addition, I have a DataView page that allows me to process through them—fixing formatting and other changes like that. Finally, I want to send the Obsidian file to shortcuts to perform some repetitive editing tasks (i.e., Changing metaData, Automatically formatting title lines. Is there a good way to do this on an iPad and a Mac without shortcuts (maybe templater, but I don’t know how to run scripts with templater?
Lastly, how is there not an Obsidian Categorie or tag on here lol?
I want to automate editing some metadata. I have a processed: No that I need to switch to Yes. I want to be able to highlight some text and add it as a line in Links:. Mostly I am wanted to learn more about scripting to automate text edit and looking for some examples to begin.
So what I have found is this snippet by pbhopeful on the obsidian forum
<%*
var file = app.workspace.getActiveFile()
var t = await app.vault.read(file)
var s = t.replace("processed: no", "processed: yes").replace("{The Griffon's Saddlebag}","{TGS}")
app.vault.modify(file, s)
%>
This is a great starting point and allows me to automate with templater to be fully cross-platform. I am very new to programming with JS and TS is there good documentation on using the app or workspace methods. I would like to use this to do some more robust editing (I.e., changing note titles, adding text to the end of the first p1 on a doc…)