This is very nice, thanks for sharing! I’ve had a few emails recenly asking for an Obsidian extension so maybe I can point them to this.
I’m really liking how with the new snippets, the source is front and centre, which invites people to see how it works and to think of customizing it.
Regarding the question. It isn’t possible currently with the “URL” extension type but you could do with with a little bit of JavaScript. I’ll have a go…
I’ve also modified it to use the markdown backing the selection rather than just the plain text.
# PopClip - Obsidian extension, markdown variant
name: OBSClipper
icon: O
capture html: true # this is needed when we want markdown text
javascript: |
const vaultName = encodeURIComponent('Test Vault')
let clipping = popclip.input.markdown
if (popclip.context.browserUrl.length > 0) { // append markdown source link if available
clipping += `\n[${popclip.context.browserTitle}](${popclip.context.browserUrl})`
}
clipping = encodeURIComponent(clipping)
popclip.openUrl(`obsidian://advanced-uri?vault=${vaultName}&daily=true&heading=Clippings&data=%0A${clipping}&mode=append`)
(The above block is an extension snippet - select it to install the extension with PopClip)
Edit to add: I got it working! I’m new to Obsidian — the following is probably obvious to Obsidian users, but for anyone trying Obsidian for the first time, I also had to enable the “Daily Note” core plugin which was disabled by default. This created a note with the current date. And I had to manually add a heading # Clippings
in the daily note before it would work (@EdM - Do we have to add the heading every day?)