Created
December 31, 2016 00:16
-
-
Save kinoshita-lab/2e3dcc8bb3ff0f0f6cfd2d1fa2c5bfcb to your computer and use it in GitHub Desktop.
highlight italic on google document
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hilightItalic() { | |
var body = DocumentApp.getActiveDocument().getBody(); | |
var editText = body.editAsText(); | |
var text = editText.getText(); | |
for (var i = 0; i < text.length; ++i) { | |
if (editText.isItalic(i)) { | |
editText.setForegroundColor(i, i, '#ff0000'); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment