[Scribus] Yet ANOTHER scripting bug

Mátis Barnabás sr_barna
Sat Dec 1 20:43:02 CET 2007


Chris Bergstresser ?rta:
> On Dec 1, 2007 7:29 AM, Gregory Pittman <gpittman at iglou.com> wrote:
>> overall conceptually should work, will check out. Perhaps this is a
>> typo, but all of your examples have unbalanced parentheses in the third
>> line.
> 
>    That's just a typo, from when I copied the original code over.
> 
>    FWIW, the snippet barna sent does work for me, using insertText("",
> 0, selected_frame) to position the cursor at the beginning of the
> line, and then calling setStyle.  It doesn't actually solve my
> problem, since my production code has multiple paragraphs per style,
> but it's at least a work-around.
> 
> -- Chris
> _______________________________________________
> Scribus mailing list
> Scribus at nashi.altmuehlnet.de
> http://nashi.altmuehlnet.de/mailman/listinfo/scribus
> 

Applying style is only avialable in the selected frame. If you link two,
or more text frames, at first have to put the text into one "unlinked"
frame, meantime apply the styles and finally link the frames.

unlinkTextFrames("name")
.
.
.
start_pos = getTextLength(selected_frame)
insertText(append_text, -1, selected_frame)
insertText("", start_pos, selected_frame)
selectText(start_pos, len(append_text), selected_frame)
setStyle(style, selected_frame)
.
.
.
linkTextFrames("fromname", "toname")


barna



More information about the scribus mailing list