I use Obsidian a lot in my iPad to save notes of interest that I find in the web, and more specifically papers.
The only problem that I have is that Templater doesn’t know I am in iOS when using the “Share” button to save the internet page to a note. It just creates a blank note -no frontmatter at all -, and pastes the link, or image, that I want to save to Obsidian.
Templater works well in the iPad if I create the note from within Obsidian. But I want to save the extra typing of frontmatter when I use the “Share” button of iOS.
Obsidian URI or rather Obsidian Advanced URI, which through ‘eval’ can take js (read up on this on the Issues pages of the latter plugin if you will) and you may be able to hook into Templater to get what you want.
This may be overdoing it and you may be better off creating some iOS Shortcuts which would match with regex where you want to file away what.
In addition, now there is Obsidian Web Clipper on iOS as well (not working for my older tablet … dang), which could be…
configured for different types of content to be saved to any folder, with any set properties;
set with title ‘Untitled’, and then when the clip gets saved (to vault root for instance), a template manager via Templater should/would open up with where the user wants to file away the clipping.
Tried Obsidian Web Clipper but it’s overkill for what I want to achieve. Besides, OWC conflicts with the default Templater template; OWC requires that an automatic or default template is disabled, otherwise it will append its frontmatter and content over the default template.
What I need is something simple: an automatic template that is triggered when Obsidian is called via the “Shared” button in iOS.
Why not try a simple iOS Shortcut (there is a shortcut thread here somewhere and there are other places) that saves the file without templates with filename ‘Untitled.md’ and use an if conditional in your template what to do if the file is named ‘Untitled’, or you can do it with ‘Webclip.md’ and act accordingly.
From the site I’ve just seen:
Not sure how that’d work with Templater but Actions seems like good stuff.
I tried all possible ways to populate a note, via a template, that is created using iOS “Share with”, and no success.
So, I came up with this workaround combining it with a script by @AlanG.
The Templater template has to be called in insert mode, not create.
<%-*
/* Inserts frontmatter to a previously existing note
This is ideal when a note is created from a LinkedIn post
or the web in a mobile device using “Share with”.
*/
const uuid = tp.file.creation_date("YYYYMMDDHHmmss");
let device = ""
var isIosApp = tp.obsidian.Platform.isIosApp
var isLinux = tp.obsidian.Platform.isLinux
var isMacOS = tp.obsidian.Platform.isMacOS
var isTablet = tp.obsidian.Platform.isTablet
var isPhone = tp.obsidian.Platform.isPhone
var isDesktop = tp.obsidian.Platform.isDesktop
if (isIosApp && isTablet) {
device = "iPad"
} else if (isIosApp && isPhone) {
device = 'iPhone'
} else if (isDesktop && isLinux) {
device = 'Linux'
} else if (isDesktop && isMacOS) {
device = 'macOS'
}
setTimeout(() => {
app.fileManager.processFrontMatter(tp.config.target_file, frontmatter => {
frontmatter['uuid'] = uuid
frontmatter['device'] = device
frontmatter['tags'] = ['linkedin']
})
}, 200)
-%>
I tried also this “Save to Obsidian” iOS shortcut. It’s a very long iOS script.
It partially works. I don’t like that It asks a lot of questions before saving a note, and second, that it sends the link you are trying to save to a server somewhere else. Still overkill for just calling an existing template when using the iOS button “Share with Obsidian”.
There are 5-6 Save to Obsidian shortcuts on the net, I think. Maybe all of them on this forum.
You can even use Js with Scriptable or shell with A-Shell in conjuction with Shortcuts.
So there are many DIY solutions. All it needs is…yet more tinkering…