enter image description hereI'm trying to make a code that changes the color of text in a presentation, this needs to change the color in several textboxes, on every page of the presentation.
I tried to use this code that I got in this question:Google Slides API- How to change text color for all shapes of a certain color
var presentation = SlidesApp.getActivePresentation();
var slides = presentation.getSlides();
for (let i = 0; i < slides.length; i++) {
var elements = slides[i].getPageElements();
for (let j = 0; j < elements.length; j++)
if (elements[j].asShape().getText().getTextStyle().getForegroundColor().asRgbColor().asHexString() == '#000000')
elements[j].asShape().getText().getTextStyle().setForegroundColor('#ff0000');
}
}
But it didn't work, the error appeared Exception: Object is not of type RgbColor. (line 7)