javascript - Google Script: interacting with footnotes -
i'm (very) new google script (and javascript) , i'm trying write script modify font size of footnotes in document. unfortunately, there little guidance can find interacting footnotes in document.
so far have tried work this base, error
cannot find function setattributes in object function getfootnotecontents() {/* */}.
i'm not looking "solve me answer", perhaps pointer how work contents of footnote or somewhere start learning process in direction.
my code follows:
function footsize() { var doc = documentapp.getactivedocument(); var footnotes = doc.getfootnotes(); var style = {}; style[documentapp.attribute.font_size] = 18; for(var 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 in footnote){ footnote[i].getfootnotecontents().setattributes(style); } }
getfootnotecontent
function retrieves footnote section can manipulate contents. try setting attribute in contents (you missed parenthesis call content function) or in footnote itself.
footnotes[i].setattribute(style); //or footnotes[i].getfootnotecontents().setattribute(style); //note parenthesis
--to address edit
after edited error not popup. you're not referencing getfootnotecontents
anymore. if setting style not work in footnote object itself, try setting in section (2nd suggestion).
Comments
Post a Comment