[scribus] Applying character styles with Scribus Scripter

José Antonio Rocha joseantoniorocha at gmail.com
Tue Apr 23 15:48:39 UTC 2013


2013/4/23 Gregory Pittman <gpittman at iglou.com>

> On 04/23/2013 05:59 AM, Syed Akbar wrote:
> > Hello,
> >
> > it does not seem to be possible to apply character styles with a Scribus
> > script. Is there any work-around or other solution to format single
> > characters in a textbox?
> >
> You're right, there is no way to apply character styles. I don't think
> there is any suitable workaround either. At various times I have tried
> to select some text, then apply some sort of change to it, and have not
> been successful. I haven't even been successful at applying a Paragraph
> Style to a single paragraph in a frame.
> Selecting text itself is very hard to work with, since one has to have
> some knowledge of the number range of characters you wish to select.
> I think this remains something that is for the time being best done
> outside of Scripter, where you can find and replace text and apply
> styles. Perhaps once we get to a fully functional new Scripter someone
> will add commands to use the Find/Replace function from within a script.
>
> Greg
>

I wrote a script to format several paragraphs at a time:

http://wiki.scribus.net/canvas/Automatic_story_formatting

See the GUI at
http://meiradarocha.jor.br/news/wp-content/uploads/2011/11/scribus-newspaper-story-builder1.png

USAGE:
Draw a text frame marking the area where you need a story,
optionaly putting text inside. Select the frame, run the script
and choose styles to be applied, numbers of columns, gutter
and guide lines.
The script will:
1. Resize the frame to hold headers.
2. Draw a second linked frame to hold text in columns.
3. Clean up the text, ripping off blank paragraphs, double spaces,
   changing quotes etc.
4. Apply the choosen styles.
5. Find and apply style to short paragraphs as sub-headers.

NEED:
Tcl/Tk 8.5 (or 8.4 with Tile 8.2)
Python 2.7 (or 2.5.4 with pyttk)


-- 
[image: Meira]
------------------------------
nome: "José Antonio Meira da Rocha"
googletalk: email: MSN: joseantoniorocha at gmail.com
veículo: [ http://meiradarocha.jor.br ]
fones: 55-8411-3047 / 55-3744-2994
------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20130423/67687b5f/attachment.html>


More information about the scribus mailing list