How to change only the *selected* text to uppercase, not the entire paragraph in which the selection exists
问题 In Google docs, this function changes the selected text to black function selectedFontColorBlack() { // DocumentApp.getUi().alert('selectedFontColorBlack'); var sel = DocumentApp.getActiveDocument().getSelection(); var elements = sel.getRangeElements(); for (var i = 0; i < elements.length; i++) { var element = elements[i]; // Only modify elements that can be edited as text; skip images and other non-text elements. if(element.getElement().editAsText) { var text = element.getElement()