Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arielsalminen/e414d03280c0403b8c2d77c05bcbfeec to your computer and use it in GitHub Desktop.
Save arielsalminen/e414d03280c0403b8c2d77c05bcbfeec to your computer and use it in GitHub Desktop.
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