Thank you @shabegom, that worked with a couple minor changes. Kudos to you for the research. Above and beyond!
I had to use the full path under the main vault or I received a folder not found error . So “001 DAILY/PAST/” instead of “/PAST/”. And I had to include the .md at the end of the api call line or the file created had no extension.
I had actually found the “renameFile” in the api command list on github yesterday but the missing part was “fileManager”. I think that api line will help a lot of people in the future.
```
<%*
const date = tp.date.now(“YYYY-MM-DD”,-1)
const file = tp.file.find_tfile(date)
if (file) {
const name = file.basename
await app.fileManager.renameFile(file, `001 DAILY/PAST/${name}.md`)
}
%>
```
===
Incidentally, there is a new feature in the latest Templater plugin that allows you to create a separate template that runs on Obsidian startup. So I took the above snippet out of my daily note and put it in a separately named template, then pointed Templater to that new template. This way my Daily Note stays clean and doesn’t have empty ```s left over after the snippet runs. Basically, Templater is becoming Obsidian Scripting. Its very cool, I open Obsidian, I see yesterday’s note disappear(rename/move to PAST folder) and today’s daily note pops into existence in the same place.