Google apps script Google Sheets脚本richtext builder输出

Google apps script Google Sheets脚本richtext builder输出,google-apps-script,google-sheets,richtext,Google Apps Script,Google Sheets,Richtext,这是我的代码,基于此: 返回我不知道如何使用的输出: com.google.apps.maestro.server.beans.trix.impl。RichTextValueApiAdapter@13134ed6 13134ed6部件随着每次运行而变化,因此我假设它确实构建了一些东西:) 有什么想法吗?您可以使用range方法将这些文本样式和富文本值应用于范围 您只需将样式应用于 const boldStyle=SpreadsheetApp.newTextStyle() .setUnderlin

这是我的代码,基于此:

返回我不知道如何使用的输出:

com.google.apps.maestro.server.beans.trix.impl。RichTextValueApiAdapter@13134ed6

13134ed6
部件随着每次运行而变化,因此我假设它确实构建了一些东西:)


有什么想法吗?

您可以使用range方法将这些文本样式和富文本值应用于范围

您只需将样式应用于

const boldStyle=SpreadsheetApp.newTextStyle()
.setUnderline(false)
.setBold(真)
.setForegroundColor(“000000”)
.build();
const testrichtext=SpreadsheetApp.newRichTextValue()
.setText(“测试”)
.setLinkUrl(0,5,“https://bar.foo")
.setTextStyle(7,10,粗体)
.build();
函数setRichText(){
SpreadsheetApp.getActive().getActiveCell().setRichTextValue(testrichtext);
}
什么是
.build()
返回的?
const boldStyle = SpreadsheetApp.newTextStyle()
    .setUnderline(false)
    .setBold(true)
    .setForegroundColor("#000000")
    .build();

  const testrichtext = SpreadsheetApp.newRichTextValue()
    .setText('testing testing testing')
    .setLinkUrl(0, 5, "https://bar.foo")
    .setTextStyle(7, 10, boldStyle)
    .build();