r/GoogleAppsScript • u/Darkbluestudios • May 10 '25
Question How to close list and add paragraph?
This has been bugging me for a while, and would really appreciate any help.
I am working with slides and want to add text to the end of speaker notes.
The problem - if the last line in the speaker notes are in a list (like a bulleted list) Then - adding text/adding a paragraph adds the paragraph to the list.
I would like to close out the list and have the text I add be outside of the list.
Might anyone have any suggestions?
----
EDIT - bare minimum code:
const presentation = SlidesApp.getActivePresentation();
const slides = presentation.getSlides();
const slide = slides[0];
const slideId = slide.getObjectId();
// https://developers.google.com/apps-script/reference/slides/notes-page
const notes = slide.getNotesPage();
const shape = notes.getSpeakerNotesShape();
const notesTextRange = shape.getText();
notesTextRange.appendParagraph('\n\nAdd Paragraph');
1
Upvotes
1
u/Darkbluestudios May 10 '25
Honestly I’ve tried many different options And I’m not sure why this is so hard
The easiest way to get the speaker notes is from the slide.getNotesPage().getSpeakerNotesShape().getText() - which returns a text range
I see I can getListParagraphs(), or getListStyle()
Or even ListItem is a type of paragraph, and it is very easy to add a list - but I don’t see how to close one
(Or to find the right thing to add the text to - so it is after and not part of a list)
2
u/catcheroni May 10 '25
Every option I see maintains the text styling of the end of current text. Would it be possible for you to close the lists manually by setting the cursor at the beginning of a new, empty paragraph and starting from there?
2
u/[deleted] May 11 '25
[removed] — view removed comment