# Move text without cutting and pasting?

**URL:** https://community.silverbullet.md/t/move-text-without-cutting-and-pasting/695
**Category:** General
**Created:** [July 21, 2024, 5:26pm UTC](https://community.silverbullet.md/t/move-text-without-cutting-and-pasting/695 "2024-07-21T17:26:12Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![justyns](https://community.silverbullet.md/user_avatar/community.silverbullet.md/justyns/32/132_2.png) [@justyns](https://community.silverbullet.md/u/justyns)
#### Post date: [August 6, 2024, 6:16am UTC](https://community.silverbullet.md/t/move-text-without-cutting-and-pasting/695/6 "2024-08-06T06:16:47Z")

</div>

Hey, I haven’t had time to improve it much but I just posted the version I’ve been using recently here:

> [@Space script to move a task to another page](https://community.silverbullet.md/t/space-script-to-move-a-task-to-another-page/812):
>
> Here’s a space script I’ve been using recently to move tasks from one note to another: async function refile(targetPage, targetHeading) { try { const cursorPos = await syscall("editor.getCursor"); const text = await syscall("editor.getText"); const currentItemBounds = await syscall("system.invokeFunction", "editor.determineItemBounds", text, cursorPos, undefined, true); const currentItemText = text.slice(currentItemBounds.from, currentItemBounds.to); const targetContent = …

I’d like to make it more generic so that you don’t need to hardcode the target page/header, but _most_ of the time I’m moving things to the same set of targets anyway.

---

_[View the full topic](https://community.silverbullet.md/t/move-text-without-cutting-and-pasting/695)._
