Move selected text to a different note, then embed the text back
Published with Share Note 🔸 Part of Obsidian guides
This script will take the text that is selected in the current source note, move it to a chosen destination note, and then embed the new location back into the current note.
It asks for a heading to insert into the destination note, to make the embedding work with source text of any length. If you only have a single paragraph of source text then you can use a block reference instead by pressing Escape or Cancel on the heading prompt.
Setup requirements
- You will need the Templater plugin (install link)
- Create a folder in your vault to store your templates.
- Add that folder in the Templater settings, in the “Template folder location”.
- Copy the full text from the template below, and put it into a new template file inside that folder.
The template
(remove the space in < %*
at the start)
Asked in these threads:
- Templater: open file in new tab and append to end of file (Oct 17, 2023)
- Extract selection to heading (Sep 22, 2023)
- Using QuickAdd to extract selected text into a new note and then embedding it in original note (Jul 29, 2023)