insertText behaving oddly

Previous topic - Next topic


I'll start off saying I'm pretty new to Scribus.  I'm a moderately experienced Python scripter though.

I started writing a script to apply some document wide formatting and text frame adjustments, part of which was inserting newlines at places where page breaks were happening in unattractive places (according to some simple rules I set).  I call insertText('\n'.encode('utf-8'), char_pos, frame) and I've verified that the frame argument is correct for each instance where I call insertText.  However, the actual location where the newline is inserted is not the frame passed in as the argument.  It seems like it's just ignoring the frame argument and inserting the newline at the target character position from the top of the document.

I'm getting the frame names by calling getPageItems().  All of the text frames in the document are linked, if that has anything to do with it.

Can anyone give me an idea how to get insertText() to insert where I want?