Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

155
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!