Quickly set and format selected text with just a click of a button.
This code is currently not published yet, so it has to be a manual temporary installation.
In google doc, click on extensions -> Apps Script: Copy code into the code editor:
Select text to be format and hit format code:
Default values are:
FONT_FAMILY = "Roboto Mono;500";
FONT_SIZE = 8;
FOREGROUND_COLOR = "#990000";
highlight or select text to get style properties from and click set format:
fill in whatever else that needed or that the script is unable to get. currently a bug that does not allow app script to get some of the font family.
select text to format and hit format code:
https://developers.google.com/apps-script/guides/menus
https://developers.google.com/apps-script/reference/document/document#getselection
https://developers.google.com/apps-script/reference/document/range
https://developers.google.com/apps-script/reference/document/text#setattributesattributes
https://developers.google.com/apps-script/reference/document/position#getSurroundingText()
https://developers.google.com/apps-script/reference/document/text
https://developers.google.com/apps-script/guides/properties
https://developers.google.com/apps-script/reference/properties