Open vertex-admin opened 1 year ago
Great! Thanks a lot for sharing! :smiley:
You can make use of the new pres.getInfo()
that came yesterday with v0.4.1
to make the code even shorter:
// ...
let pres = automizer.loadRoot(rootTemplate).load(extraTemplate, templateName);
// getInfo() is a tiny wrapper around setCreationIds():
const presInfo = await pres.getInfo();
// Count the total number of slides
const totalSlides = presInfo.slidesByTemplate(templateName).length;
console.log(`Processing ${totalSlides} slides!`);
// Loop through all the slides
// ...
Best regards and keep on sharing!
It took me hours to figure this out so thought I'd share a quick workaround on how to: i) loop through all the slides in a presentation ii) replace all instances of the text you want to replace, without needed to know/hardcode the selector names
This won't work for text in tables though, if anyone has a tip on how to do that, I'd be happy to try.