How do you change formatting within a google doc for multiple occurrences using findText()?
问题 I am trying to find text within a google doc and replace with a subscript notation - replace "a3" with a3 but with the 3 now formatted as a subscript. based on the answer here I wrote some code that is working but only replaces the 1st instance of any occurrence (some are repeated). I wrote the following: for (var k=0; k<subscriptsReplace.length; k++) { subscript = ' a'+subscriptsReplace[k]; find = ' a'+subscriptsReplace[k]+' '; Logger.log(find) var element = body.findText(find); if(element){