Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

162
Visualizações
How to get the color and text value of a shape using objetcid in slides app using apps script?

I´m tying to get the color and the text value from a Google slides shape. The shape is a google drawing created shape. First, I used below code to set this shape color using a color that I have into a Spreadsheet. The function run perfect. I do the same with the text of shape and I haven´t got any problem. But when I try to get the color and text from a shape into google slides to copy in a spreadsheet not work...

This is the function to set color of a shape using the objectid :

function setColor() {
      const objectId = "g11262e0cb1e_0_256"; 
      const hexColor = SpreadsheetApp.openById(ssurl).getSheetByName("data")
      .getRange("D1").getValue();
      const slide = SlidesApp.openById(slideurl).getSlides()[0];
      var obj = slide.getShapes().filter(s => s.getObjectId() == objectId);
      if (obj.length > 0) obj[0].getFill().setSolidFill(hexColor,1);
    }

This is the function to get color of a shape using the objectid :

function getColor() {
        const objectId = "g11262e0cb1e_0_256";  
        const slide = SlidesApp.openById(slideurl).getSlides()[0];
        var obj = slide.getShapes().filter(s => s.getObjectId() == objectId);
        if (obj.length > 0) obj[0].getFill().getSolidFill();
        //console.log(obj);
        SpreadsheetApp.openById(ssurl).getSheetByName("data")
        .getRange("I1").setValue(obj);      
        }
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda