So the above sample produces the following log statements: Text: Hello Bold: false
When reading styles, the function returns null if the range has multiple valuesįor the style. Is bolded, linked to and its color is set The above example first creates a text box on the first slide and sets itsĬontent to "Hello ". Logger.log('Text: ' + textRange.asString() + ' Bold: ' + textRange.getTextStyle().isBold()) Logger.log('Text: ' + insertedText.asString() + ' Bold: ' + insertedText.getTextStyle().isBold()) Logger.log('Text: ' + helloRange.asString() + ' Bold: ' + helloRange.getTextStyle().isBold()) Var helloRange = textRange.getRange(0, 5) setLinkUrl('.setForegroundColor('#ff0000') Var insertedText = textRange.appendText('world!') The TextStyle object covers the same text as its parent TextRange. The getTextStyle() function of a text range provides a TextStyle object used for Text style determines the rendering of text characters in your presentation, Text run is a segment of text where all the characters have the same text getRuns(), which provides the text runs that overlap the current text range.getListParagraphs(), which returns the list items in the current text range.Paragraph is a sequence of text which terminates with the newline character, getParagraphs(), which provides all paragraphs which overlap the text range.TextRange provides functions to return useful collections of text entities. It can be used along with setText() for performing find-and-replace The find() function on TextRange returns the instances of a string within the Use the replaceAllText() function on presentation or page to perform a globalįind and replace across the entire presentation or a specific page. The above example produces theįollowing log statement: Start: 0 End: 14 Content: Hello galaxy! Search and replace Inserts the text "galaxy" at index 6 instead. It then deletes characters 6 through 11 ("world"), and This script creates a text box on the first slide and sets its text content The following script demonstrates the use of these functions: