使用 google 应用程序脚本以编程方式将脚注附加或插入到 google 文档中
Appending or inserting footnotes programmatically into google doc using google app script
我正在使用 Google App Script 生成新的 google 文档。文档的内容来自一个循环的数组,并添加了段落元素,或者文本元素 inserted/appended 到循环中较早的预先存在的段落元素。
问题是:数组中的一些项目需要作为脚注元素追加或插入。
文档说脚注元素包含在 listItem 或段落元素中。然而,似乎没有一种方法可以以编程方式插入脚注,就像可以将其他元素插入段落中一样 - 例如 appendText() 和 appendHorizontalRule() 等
我没有发布任何代码,因为我不知道从哪里开始解决这个问题。任何指导表示赞赏。
根据 Apps 脚本文档,
...there are rules about which types of elements can contain other
types. Furthermore, the Document Service in Apps Script can only
insert certain types of elements. The tree below shows which elements
can be contained by a certain type of element.
此处有更多详细信息https://developers.google.com/apps-script/guides/docs
Footnote 和 FootnoteSection 元素未突出显示,这意味着它们无法以编程方式插入。
我正在使用 Google App Script 生成新的 google 文档。文档的内容来自一个循环的数组,并添加了段落元素,或者文本元素 inserted/appended 到循环中较早的预先存在的段落元素。
问题是:数组中的一些项目需要作为脚注元素追加或插入。
文档说脚注元素包含在 listItem 或段落元素中。然而,似乎没有一种方法可以以编程方式插入脚注,就像可以将其他元素插入段落中一样 - 例如 appendText() 和 appendHorizontalRule() 等
我没有发布任何代码,因为我不知道从哪里开始解决这个问题。任何指导表示赞赏。
根据 Apps 脚本文档,
...there are rules about which types of elements can contain other types. Furthermore, the Document Service in Apps Script can only insert certain types of elements. The tree below shows which elements can be contained by a certain type of element.
此处有更多详细信息https://developers.google.com/apps-script/guides/docs
Footnote 和 FootnoteSection 元素未突出显示,这意味着它们无法以编程方式插入。