Issues moving created file to specific folder after template population

Hello,

I am currently trying to set up a small template for some small definition notes. The template itself is not important to the issue, as it is properly created each time.

I do so by executing “Create Note from Template”, then excute the following script-note:

<% tp.file.create_new(tp.file.find_tfile("100_Template_Knowledge"), await tp.system.prompt("Set FileName"), true) %>
<% await tp.file.move("000 Output/" + tp.file.title) %>

The first line opens a modal, ask for the file name and then executes the template.
And after that I want to move the file to the directory “000 Output”. I tried doing so with tp.file.move() as shown above, both with and without the await keyword before it.

Regardless of it, templater will create the file as expected, but within the folder of the currently active note. Meaning if I am working on a file in 200 U/04/27.4/1, it will be created in that directory.
If I happen to focus a template in my template folder 002 templates, the resulting note is put into 002 templates. And so on.

Additionally, at the indented destination “000 Output”, an “Untitled” file is created containing the string

[object Object]`n`n

(where “`n`n” represents an two line breaks, and thus an additional empty line).

I don’t know what/how to resolve it.

What exactly am I doing wrong?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.