Setting a style and resizing a text box

Previous topic - Next topic


In order to automate my workflow a little, I decided to take the excellent script that resizes text boxes and add a line to apply a style to the text box before it does it's resize.

The script in question can be found here:

I used the script to do the vertical adjustment.

I'm adding the following line to the script to set the style of the text box.

scribus.setStyle("Stamp Name", frame)

I want the style to apply to the whole frame and overwrite all existing styles in the frame.  That doesn't seem to be happening.  I'm only getting some of the text inside the box to have the new style applied.

My best guess is that I may need to clear all the formatting inside the text box.

So, I created a new text box and ran the script against it.  It appears the style was applied, but only to the first line.

If I make a one line text box, the style looks correct, but if I click on the text box and go to the Styles section of the properties pallet, it tells me there is no paragraph style applied.  If I apply it manually, the style sticks in the Properties pallet.

I'll continue looking through the documentation, but I was hoping someone might have done this before and had some code that would save me some time.


So I figured out that if I change the setStyle line to:

scribus.setStyle("Stamp Name")

the entire text box gets reformatted.  The properties on the text box still show no Paragraph style, but when I edit the text box it shows the style.  So, I think I'm good enough.


Nope.  I was wrong.  Still not working.  Any help greatly appreciated.