Is there a way to delete a paragraph style in a script?

Previous topic - Next topic

dtribby

I'm testing out Scribus 1.6.2 after having used 1.4.x for years. The main sticking point is all of the extra paragraph styles created when loading text from a file.

I've got a script that will tell me all of the unused paragraph styles whose names begin with the name of the current frame. I would like to delete all of them from the script, but could not find a Scribus function that does that action.

Is there a way to delete a paragraph style from a script?

a.l.e

I did a quick search and, indeed, the command seems to be missing from the scripted API.

But it's probably easy to add.

On Thursday, I could give it a try.

dtribby


a.l.e

I started to work on it...

... With a bit of luck, Saturday I could have a patch ready...

dtribby

Did the new function to delete a paragraph style make it into Scribus version 1.6.3? I don't see it in the "For Developers/Scripter API/Creating & Manipulating Styles" section of Scribus Help for 1.6.3.

In the script, I tried
 deleteParagraphStyle(style)
but got the "name ... is not defined" error.

a.l.e

Sorry, no.

I did some work on it, but the existing code for deleting styles is more intricate than I would have thoughts.

I still don't understand the meaning of all the arguments and how to make it work without being tightly bound to the Style manager.

I have not given up yet, and need to find some time to further dig into this...