New line in JavaScript cons


Just started working with drafts and I have some nice ideas on how this can work out in my daily routines. Now I am struggling with the following.

I created a new action that basically builds template for my daily note taking. Idea is to afterwards break the action points out and send them to Todoist and send all the rest to either Evernote or Notion.

I created a script that makes a first line, with the date in particular format and the name of the day.
Nee thing is that I (for now) have a second step where I come up with a standardized template for note taking for the day.

Issue is now that the text is directly after the first line. They are on the same line. I need to get some kind of hard return or /br in the first line.

code now is roughly:

const subjectdate = yyyy+mm+dd+’ '+day;

d.content = subjectdate;

I googled around but was not able to figure out how to get a hard return after the day variable in subjectdate.
Any help is appreciated.

\n is what you’re looking for - it’s a string and you would include it after day.

As a tip, you can use three ` symbols around your code to have it formatted properly :slight_smile:

Thanks for your reply. I tried /n but I did not got it working.
not sure what you mean with three ’ symbols.

Okay. Got the \n working. Think I mixed up before. Thanks for the help!

For any other code now looks like:

const subjectdate = yyyy+mm+dd+’ ‘+day+’\n’;

Backticks, not apostrophes. They format things as code in Markdown. On most iOS keyboards if you press and hold the ’ it’s the one on the far left.

Ahh thanks. Did not notice the difference. I use a physical keyboard with my iPad. have not seen it on this one. But now know how to fix it.

I know on my UK keyboard it’s right of the left shift key, I’m not sure off the top of my head where it is on other keyboards.

This is the iPad Smart Keyboard, and it’s the key to the left of the 1key.

Thanks I use a Logitech keyboard, it is not looking the same.
But with the soft keyboard I am able to manage. Thanks for the help and the heads up.

On my Logitech keyboard it’s to the right of the left shift key. (Bought in UK from Apple Store in Regent Street, in case this is relevant.)