0

I' m trying to repetetive presentation with Google Slides starting from the events on Google Calendar using an API.

I was able to replace some text, but I'd like to delete all the text after the last text replacement. I've tried with replacing all the remaining text with a blank space, but i exceeded the quota limit, so maybe it's easier to just delete it.

(I hope it's understandable even in my broken english).

I hope you'll help me-

This is the function i use to replace the text (and it works fine):

def text_replace(old: str, new: str, presentation_id: str, pages: list = []):
    slides_service = build('slides', 'v1', credentials=creds)

    slides_service.presentations().batchUpdate(
        body={
            "requests": [
                {
                    "replaceAllText": {
                        "containsText": {
                            "text": '{{' + old + '}}'
                        },
                        "replaceText": new,
                        "pageObjectIds": pages,
                    }
                }
            ]
        },
        presentationId=presentation_id
    ).execute()

this is one of the slides i want to change

In the slide there's a single text box, and i wanted to know if it was possible to delete automatically some text

6
  • I have to apologize for my poor English skill. Unfortunately, I cannot understand but I'd like to delete all the text after the last text replacement.. Can I ask you about the detail of the current issue of your script and your goal? Commented Mar 12, 2023 at 23:35
  • So basically I’m trying to pull all the events from a Google calendar and put them in a presentation so that it can be played in a monitor, as a daily agenda. So I created a presentation on Google slide in which I replace the text, but not all text get replaced, and I want to eliminate the remaining text Commented Mar 12, 2023 at 23:46
  • Thank you for replying. I apologize for my poor English skill, again. Unfortunately, I couldn't understand I created a presentation on Google slide in which I replace the text, but not all text get replaced, and I want to eliminate the remaining text. But I would like to try to understand it. When I could correctly understand it, I would like to think of a solution. I would be grateful if you can forgive my poor English skill. Commented Mar 12, 2023 at 23:54
  • 2
    Please provide enough code so others can better understand or reproduce the problem. Commented Mar 13, 2023 at 0:47
  • 1
    Thank you for replying. From your reply, I think that I understood your question. But, in this case, it is required to know your current script. So, I agree with the comment of Community Bot. Commented Mar 13, 2023 at 2:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.