Juraj has written patches to add an applyMasterPage command to scripter.
After applying the patch, you can assign master pages by modifying his example
script below.
Scribus 1.4 patches are at http://bugs.scribus.net/view.php?id=12757
Scribus 1.5 patches are at http://bugs.scribus.net/view.php?id=12758
import scribus
scribus.newDocument(scribus.PAPER_A4, (15,15, 20, 20), scribus.PORTRAIT, 1,
scribus.UNIT_POINTS, scribus.PAGE_2, 1, 8)
def create_mp(name): scribus.createMasterPage(name)
scribus.editMasterPage(name) txt=scribus.createText(250, 70, 120, 30)
scribus.setText(name, txt) scribus.closeMasterPage() return name
odd = create_mp('Odd Master Page')even = create_mp('Even Master Page')
for p in range(8): page = p+1 name = odd if page%2 == 0: name =
even print (name, page) scribus.applyMasterPage(name, page)
scribus.saveDocAs('masterpage.sla')
pdf = scribus.PDFfile()pdf.save()
#scribus.applyMasterPage('Wrong Name', 1)#scribus.applyMasterPage(even, 42)
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.scribus.net/pipermail/scribus/attachments/20141008/1921f3ed/attachment.html>