脚注是Google中的对象,因此需要访问每个对象并提取字符串文本。你需要使用
.getFootnoteContents()
与
.copy()
Footnote
More on the
copy
method
将代码更改为:
function appendiNote() {
// Gets all footnotes in the document as an iterable array
var notes = DocumentApp.getActiveDocument().getFootnotes();
// iterate through the notes array
for (var i = 0; i < notes.length; i++) {
// for each item, get the contents of the object
var note = notes[i].getFootnoteContents();
// create a deep copy of the object, which includes styles.
var par = note.getChild(0).copy();
// Append the footnote, including styles, as a paragraph in the body of the doc.
DocumentApp.getActiveDocument().getBody().appendParagraph(par);
}