Scribus Forums

Scribus => Scripts and Plugins => Topic started by: ancientgeek on October 12, 2014, 10:32:18 AM

Title: enumerating (listing) defined character styles
Post by: ancientgeek on October 12, 2014, 10:32:18 AM
How do I enumerate the currently defined character styles in Python?
I need to make sure that certain character styles are defined in the current Scribus document.
Title: Re: enumerating (listing) defined character styles
Post by: Rummidge on June 29, 2015, 04:07:06 PM
I know this topic is quite old but...

I am also interested in the topic you were, but I still got no answers. Meanwhile, I have partially solved (or avoided) your problem as you described it:

QuoteI need to make sure that certain character styles are defined in the current Scribus document.

by ensuring a given Master Page is loaded, something you can check via something similar to:

    def checkValidMasterPage(self,masterPageName):
        # if CD Sleeve is not a defined as a masterpage in the current document, we cannot use it
        if masterPageName not in scribus.masterPageNames():
            scribus.messageBox('Usage Error', 'You need a CD Sleeve Document open', icon=0, button1=1)
            sys.exit(2)


Good luck if you are still around!

It would be nice if the new API makes life easier in dealing with styles.