[scribus] a wiki page with a script using applyMasterPage()

a.l.e ale.comp_06 at xox.ch
Fri Oct 10 09:45:55 UTC 2014

hi greg,

> I can confirm that the new Scripter command does work, based on the 
> script I wrote that I show on this wiki page:
> http://wiki.scribus.net/canvas/Using_the_new_applyMasterPage%28%29_command 

just a detail: you should not put "#!/usr/bin/env python" at the 
beginning of your scripts. it's useless (since they are always triggered 
as `python script-name.py` and gives the false impression that one can 
run them from the command line.

> The script first shows you a list of Master Pages in your document, 
> each indexed by a number. It asks you to choose by number the MP you 
> want to assign.
> After that, you then get a dialog asking for a list of pages to apply 
> this MP to. As written, you have to explicitly enter each page number, 
> like 1 4 8 13 and so on, only separated by white space. I do it this 
> way to make use of the Python split command to create a list out of 
> the entry. It would be nice to be able to enter something like 1 5 
> 7-10 15, but parsing that 7-10 is more challenging, and besides this 
> is just a demonstration script.
i have not tested it, but this seems to be a very simple way of 
"exploding" the page numbers :-)


> I'd like to figure out how to drop the kludgy ending if I can find 
> some other way to force a document refresh in Scribus.

otherwise a nice sample of what can be done with the new commands!


More information about the scribus mailing list