Groups
Groups
Sign in
Groups
Groups
Google Apps Script Community
Conversations
Labels
About
Send feedback
Help
Is there a simplified way to add background image to all slide using appscript.
118 views
Skip to first unread message
Rakesh Raju
unread,
Aug 22, 2023, 10:41:02 AM
8/22/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Apps Script Community
const
slide
File
=
SlidesApp
.
openById
(
bookFile
.
getId
());
let
slides
= slide
File
.
getSlides
();
slides
.
forEach
(
slide
=> {
slide
.
getBackground
().
setPictureFill
(
blobdata
);
});
cwl...@gmail.com
unread,
Sep 2, 2023, 10:40:42 PM
9/2/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Apps Script Community
Try this:
function
myFunction
() {
var
slidesBackground
=
SlidesApp
.
getActivePresentation
().
getMasters
()[
0
].
getBackground
()
var
bgdImg
=
"
https://theonebrief.com/wp-content/uploads/2020/04/Screen-Shot-2020-04-28-at-10.48.37-AM.png
"
slidesBackground
.
setPictureFill
(
bgdImg
)
}
so this should work:
const slideFile = SlidesApp.openById(bookFile.getId());
slideFile.getMasters()[0].getBackground().setPictureFill(
blobdata
)
Rakesh Raju
unread,
Sep 5, 2023, 4:12:19 AM
9/5/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Apps Script Community
Thanks bro. That worked.
Reply all
Reply to author
Forward
0 new messages