スライドに配置されている図形内の文字色を#434343に一括変更したくて書いたコードです。
前提条件
SLIDE_IDで指定されたスライドのページには一つの図形があり、その図形にはテキストが入力されている
コード.gs
function changeFontColor() {
const slideUrl = 'https://docs.google.com/presentation/d/SLIDE_ID/edit#slide=id.p';
const slide = SlidesApp.openByUrl(slideUrl);
const slides = slide.getSlides();
const textColor = "#434343";
const startPage = 0;
const endpage = slides.length
for(let i = startPage; i < endpage; i++) {
const element = slides[i].getShapes()[0];
element.getText().getTextStyle().setForegroundColor(textColor);
}
}
|
