[scribus] applying text filters when importing text with a script
Chantal Rosmuller
chantal at antenna.nl
Wed Aug 12 07:47:49 CEST 2009
On Thursday 06 August 2009 15:41:21 John Culleton wrote:
> 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?
Thanks for the idea, we could do that but I would like people to write in a
wiki because I want to keep the layout options as minimimal as possible
Writers tend to fiddel with and break the layout. And a lot of people that are
writing on the document work from home where they have openoffice, or microsoft
office 2003 , or 2007 .... etc etc
And then they start emailing each other different versions of the document, and
at the end nobody knows which document is the latest version :). It would be
really cool if I can import wiki text and apply styles to it. I already can
import text and images and create and resize textboxes automatically. I will
put the script on the wiki when it is finished.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20090812/2882facf/attachment.htm>
More information about the scribus
mailing list