How to use a line break in an alert/prompt dialog in Google Apps Script? How to use a line break in an alert/prompt dialog in Google Apps Script? google-chrome google-chrome

How to use a line break in an alert/prompt dialog in Google Apps Script?


I went through this same problem. This actually works:

\r\n


I have implemented this type of messaging inside a Google doc using the following code:

var doc = DocumentApp.openById('your long doc ID');var body = doc.getBody();body.appendParagraph("Line 1");body.appendParagraph("Line 2");

or you could do it in a sheet using:

sheet.appendRow(['line1col1','col2']);sheet.appendRow(['line2col1','col2']);