Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save thecloudranger/0d2e1b3de70b32008482aaf2612c1483 to your computer and use it in GitHub Desktop.

Select an option

Save thecloudranger/0d2e1b3de70b32008482aaf2612c1483 to your computer and use it in GitHub Desktop.
# PopClip - Obsidian extension, markdown variant
# Source https://forum.popclip.app/t/clip-selection-to-obsidian/359/4
name: OBSClipper
icon: O
options:
- identifier: vault
label: Vault Name
type: string
capture html: true # this is needed when we want markdown text
javascript: |
const vaultName = encodeURIComponent(popclip.options.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`)
#end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment