[Scribus] templates and scripting
Craig Ringer
craig
Fri Feb 18 06:07:17 CET 2005
On Thu, 2005-02-17 at 21:49 -0700, Joe Van Andel wrote:
> With scribus 1.2.1, I'm trying to use the "scribus.newPage() function
> to create a new page, using a template. I've already created a
> template, called "4picture_half_sheet1", which shows up in the
> gallery of templates. However, when I use this template name in my
> python script, I simply get a blank page.
Hmm... need to put a check in there somewhere so that a missing template
throws an exception, then. Silent failures are generally not a good
things.
> ScribusApp::Apply_Temp() is called from "newPage()", and compares its
> "in" parameter to the list of known templates, in view->MasterNames.
> I added debug statements to the C++ code and dumped out the contents
> of view->MasterNames, which contains the template names:
> Experimental
> Experimental2
> Normal
>
> ----------------
> None of these names match the existing templates in the "gallery"
> (File->new from template). How do I get my template added to the
> view->MasterNames list, so I can use if from the scribus.newPage()
> function?
I'm pretty sure the "templates" being referred to are page templates.
They're a different thing to the document templates used with 'new from
template'. You'll find the templates in "Page->Apply Template" and
"Edit->Templates".
Page templates are used for things like applying a standard banner and
footer to a page.
With document templates, you can actually just open the .sla from the
scribus/templates directory then save it somewhere else. It'll be easier
to reliably locate the templates dir in 1.3, because it's path is
visible in a constant that's exported to the scripter.
--
Craig Ringer
More information about the scribus
mailing list