Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

159
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda