[scribus] [scribus-dev] Add-In Development Export Styles as CSS

Rob Oakes LyX-Devel at oak-tree.us
Mon Jan 30 00:34:49 UTC 2012


On 1/29/2012 10:20 AM, José Antonio Rocha wrote:
>> Is there a way to get the path and name of the currently open document?
>
> The last function do that:
>
> def parseDoc():
>     ''' Get attributes from current Scribus doc.'''
>     debug()
>     global styleList
>     parser = xml.parsers.expat.ParserCreate('UTF-8')
>     parser.StartElementHandler = start_element
>     try:
>         docName = scribus.saveDoc()
>         *# Undocumented Scribus 1.3.9 function: **
> **        docName = unicode(scribus.getDocName())*
>         file = open(docName,'r')
>         parser.ParseFile(file)
>         file.close()
>     except:
>         print "Error analising doc."
>         earlyExit()
>     styleList = scribus.getAllStyles()
>     styleList.sort()

Jose, thank you. This is exactly what I was looking for. I'm working on
the CSS script now and will send it to the list as soon as I finish.

Cheers,

Rob



More information about the scribus mailing list