Created
January 16, 2023 15:21
-
-
Save thecloudranger/0d2e1b3de70b32008482aaf2612c1483 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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