Created
April 27, 2021 15:02
-
-
Save arielsalminen/e414d03280c0403b8c2d77c05bcbfeec to your computer and use it in GitHub Desktop.
This file contains 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 onOpen(e) { | |
SlidesApp.getUi() | |
.createMenu("Custom Fonts") | |
.addItem("Georgia", "formatText") | |
.addToUi(); | |
} | |
function formatText() { | |
var selection = SlidesApp.getActivePresentation().getSelection(); | |
if (selection) { | |
var selectionType = selection.getSelectionType(); | |
if (selectionType == SlidesApp.SelectionType.TEXT) { | |
var slide = SlidesApp.getActivePresentation().getSlides()[0]; | |
var shape = slide.getPageElements()[0].asShape(); | |
var textRange = shape.getText(); | |
textRange.getTextStyle().setFontFamily("Georgia"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment