Jim-Chiew / Google-Doc-Style-Formatter

A script to quickly format selected text in google docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Google-Doc-Style-Formatter

Quickly set and format selected text with just a click of a button.

Setup

This code is currently not published yet, so it has to be a manual temporary installation.

In google doc, click on extensions -> Apps Script: image Copy code into the code editor: image

Save project:
image

Run: image

Allow Permissions: image

All done:
image

Quick start guide

Select text to be format and hit format code: image

image

Default values are: FONT_FAMILY = "Roboto Mono;500";
FONT_SIZE = 8;
FOREGROUND_COLOR = "#990000";

Setting format attributes:

highlight or select text to get style properties from and click set format: image

image

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. image

select text to format and hit format code: image

image


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

About

A script to quickly format selected text in google docs


Languages

Language:JavaScript 100.0%