I’m still very new to Templater, but I got these 2 commands working separately, but now I want to apply those actions to a single file, meaning I want to rename it and then move it to a specific folder:
<% tp.file.move("/Personal/Journal (Personal)/" + tp.file.title) %>
<% await tp.file.rename("Journal - "+ tp.date.now("YYYY, MMM DD"))%>
I tried the following, but it didn't work (solution offered by ChatGPT):
<%*
await tp.file.rename("Journal - " + tp.date.now("YYYY, MMM DD"))
await tp.file.move("/Personal/Journal (Personal)/" + tp.file.title)
%>
EDIT: I told GPT that the script didn’t work and only one of the commands were successful and it offered another solution and seems to work:
<%*
const newTitle = "Journal - " + tp.date.now("YYYY, MMM DD");
await tp.file.rename(newTitle);
await tp.file.move("/Personal/Journal (Personal)/" + newTitle);
%>
If anyone has another (better) option, feel free to share. Again, I’m new to Templater so it’s always good to learn more about it and seeing how others approach this.