[scribus] applying text filters when importing text with a script

John Culleton john at wexfordpress.com
Thu Aug 6 15:41:21 CEST 2009


On Thursday 06 August 2009 08:41:03 am a.l.e wrote:
> hi greg
>
> >>>> I am writing a script that imports text and images and
> >>>> automatically creates and resizes text frames. I would also
> >>>> like to automatically apply
> >>>> styles, I had a look at setStyle but setStyle applies a
> >>>> style to a whole
> >>>> frame and I want the style to depend on the content.
> >>>
> >>> doesn't setStyle() apply to the current selection as all the
> >>> other formatting commands?
> >>>
> >>> if not, please fill a bug!
> >>>
> >>> have fun
> >>> a.l.e
> >>>
> >>> _______________________________________________
> >>> scribus mailing list
> >>> scribus at lists.scribus.net
> >>> http://lists.scribus.net/mailman/listinfo/scribus
> >>
> >> Yes it does work but how can I select part of a textframe
> >> based on the content? For example, select text that starts
> >> with ====== and ends with ======
> >> ?
> >
> > I think this is beyond what Scripter can do now, though a nice
> > idea.
>
> well, i'm not sure you're right here...
>
>
> the thread continued with a few private mails:
>
> """
> with python's string (or regexp) libraries you can find where the
> ===== in the frame are; then you use scribus.selectText() to
> select the text...
>
> (if the formatting you want to apply is more complicated, you may
> have to build a simple parser instead of just searching for
> strings...) """
>
> it won't be easy, but it may be doable :-)
>
>
> have a nice day!
> a.l.e
>

How about creating the document in Open Office, applying styles 
there, and importing it? 

-- 
John Culleton
Create Book Covers with Scribus/e-book $5.95
http://www.booklocker.com/books/4055.html




More information about the scribus mailing list