【问题标题】:Break line in google form title and description谷歌表单标题和描述中的换行符
【发布时间】:2021-11-30 18:56:05
【问题描述】:

我创建了一个谷歌表单并试图在标题中插入一行。我找到了在问题中插入行的脚本,但找不到任何标题脚本。 我知道我需要在脚本部分使用 /n 来插入一行,但不知道实际该怎么做以及我还需要什么脚本。

我需要在标题中写下 A /n B /n C

谁能帮帮我?

【问题讨论】:

标签: google-apps-script google-sheets google-forms


【解决方案1】:

请注意,您的/ 斜线在您的问题中是错误的。必须是\。将其插入您的应用脚本中,您应该能够看到它工作...

function quickTest() {
  const aForm = FormApp.getActiveForm();
  const doubleLine = "first line\nsecond line"

  aForm.setTitle(doubleLine)
  aForm.setDescription(doubleLine);
  var aItem = aForm.getItems()[0];
  aItem.setTitle(doubleLine);
  aItem.setHelpText(doubleLine);
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-09-17
    • 1970-01-01
    • 2015-06-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-14
    相关资源
    最近更新 更多