I'm (very) new to google script (and javascript) and I'm trying to write a script to modify the font size of the footnotes in my document. Unfortunately, there is very little guidance that I can find for interacting with footnotes in a document.
So far I have tried to work from this base, but I get the error
Cannot find function setAttributes in object function getFootnoteContents() {/* */}.
I'm not looking for a "solve this for me answer", just perhaps some pointer as to how to work with the contents of a footnote or somewhere to start the learning process in that direction.
My code is as follows:
function footSize() {
var doc = DocumentApp.getActiveDocument();
var footnotes = doc.getFootnotes();
var style = {};
style[DocumentApp.Attribute.FONT_SIZE] = 18;
for(var i in footnotes ){
Logger.log(footnotes[i].getFootnoteContents.setAttribute(style));
}
}
SOLUTION using Henrique's answer:
function footSize() {
var footnote = DocumentApp.getActiveDocument().getFootnotes();
var style = {};
style[DocumentApp.Attribute.FONT_SIZE] = 18;
for(var i in footnote){
footnote[i].getFootnoteContents().setAttributes(style);
}
}