Trying to populate the title of a note with a date (automatically) and title (from prompt)

What I’m trying to do

Usually, I type my class notes with the format {classname} YY-MM-DD. An example of this is “CS311 23 09 12”. I found a post with something similar from 2 years ago, but I get parsing errors in my own code.

Things I have tried

So far, I have code that looks like this:

<%*
  let title = tp.file.title
  if (title.startsWith("Untitled")) {
	title = tp.date.now("YY-MM-DD")
    title += await tp.system.prompt("Title");
    await tp.file.rename(tp.date.now(`${title}`);
  } 
%>

I’m not sure how to debug this. Any suggestions would be appreciated.

Haven’t had a chance to debug (just looking at it from my phone), but it looks like you’re missing a closing parenthesis from the last line in your “rename” action.

2 Likes

This was the issue! Thanks

1 Like

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