<%*
const title = tp.file.title
if (tp.file.content !== "") {
    // if file already had content, do nothing
}
else if (/^20\d\d-[01]\d-[0-3]\d_\d\d-\d\d-\d\d$/.test(title)) {
    const file = tp.file.find_tfile(tp.file.path(true));
    await tp.app.vault.delete(file);
    await tp.file.create_new(tp.file.find_tfile("timestamped"), title, true, "timestamped");
}
else if (/^20\d\d-[01]\d-[0-3]\d$/.test(title)) {
    const file = tp.file.find_tfile(tp.file.path(true));
    await tp.app.vault.delete(file);
    await tp.file.create_new(tp.file.find_tfile("daily"), title, true, "periodic/daily");
}
else if (/^20\d\dw[0-5]\d$/.test(title)) {
    const file = tp.file.find_tfile(tp.file.path(true));
    await tp.app.vault.delete(file);
    await tp.file.create_new(tp.file.find_tfile("weekly"), title, true, "periodic/weekly");
}
else if (/^20\d\d-[01]\d$/.test(title)) {
    const file = tp.file.find_tfile(tp.file.path(true));
    await tp.app.vault.delete(file);
    await tp.file.create_new(tp.file.find_tfile("monthly"), title, true, "periodic/monthly");
}
else if (/^20\d\dq[1-4]$/.test(title)) {
    const file = tp.file.find_tfile(tp.file.path(true));
    await tp.app.vault.delete(file);
    await tp.file.create_new(tp.file.find_tfile("quarterly"), title, true, "periodic/quarterly");
}
else if (/^20\d\d$/.test(title)) {
    const file = tp.file.find_tfile(tp.file.path(true));
    await tp.app.vault.delete(file);
    await tp.file.create_new(tp.file.find_tfile("yearly"), title, true, "periodic/yearly");
}
%>