Do you know, that you can split your document on paragraph style level, if you click the checkbox in the tagsexport tab of the paragraph style?
So I would recommend, not to split in InDesign, instead split it during the export for PDF or EPUB.
thank you so much for your answer. I do indeed know that option exists, but I am not looking to create multiple files, merely multiple text frames within the same document. This is because I would want individual chapters to be formatted somewhat differently, including the transparency of the text frame background fill.
So I've managed to find the pages where the chapter headers are (var myChapterStart) in a loop, as well as the corresponding text frame on it (var myCurrentTextFrame). I can make a new page with overridden master text frame before every chapter header, but I'm a bit lost as to what the most efficient way to transfer the rest of the text into that frame (and repeat for all other chapters). My attempts so far basically all lead to the application crashing - any help would again be greatly appreciated!