\n not working in google apps script Browser.msgBox

google-apps-script

Solution

You need to double-escape "\n" for historical reasons

function myFunction() {
  Browser.msgBox("Hello\\nWorld")
}

Problem

I am trying the following to add line breaks to a message box but it is not working. ``` function showMsgBox(){ var msg = 'name: \n \n \n Doc URL'; Browser.msgBox("Selected Doc template:", msg, Browser.Buttons.OK); } ``` I does not matter single or double quotes. I also tried `Browser.msgBox(msg);` but it is all the same. What am I doing wrong? Thank you.

Original source