Copy and rename a file instead of moving it #1206
Answered
by
GNeulaender
GNeulaender
asked this question in
Help
-
I'm new to Templater (and Obsidian as a whole) and have been struggling to workout the tp.obsidian commands. Is there a way to copy a file from one folder to another instead of moving it? |
Beta Was this translation helpful? Give feedback.
Answered by
GNeulaender
Sep 26, 2023
Replies: 1 comment 2 replies
-
You can use tp.file.create_new and give it the current file's contents (tp.file.content) to do this. <%*
const folder = app.vault.getAbstractFileByPath("FOLDERNAME");
await tp.file.create_new(tp.file.content, "FILENAME", false, folder);
-%> |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I do think now I found a solution using some of your code. Thanks for the help!