[Scribus] Adding Text Frame to Master Page

Pierre Marchand capparis
Wed Dec 7 11:57:46 CET 2005


Le Tue, 6 Dec 2005 12:21:50 +0000, John <nesredep at gmail.com> m'a
transmis le message suivant :

> Start up Scribus 1.3.2cvs
> 
> It opens to New Document dialog. Use all defaults, click ok.  Get
> document view, first page.
> 
> Edit master pages; edit normal by placing a 2 inch square text frame
> in center of page.
> 
> Close "edit master page" and thereby return to document view.
> 
> The text frame is now visible (dotted lines), but it doesn't behave
> like a text frame.  (Can't "get Text", etc)
> 
> What am I missing?  Probably something dumb, but I just don't see it--
> I have looked through the Wiki, tutorials, Googled...and I'm stuck.
> 
> John

May it helps, I made a dirty little script.

===============================================================================
#!/usr/bin/env python
# -*- coding: utf-8 -*-

""" Create text frames on all pages """

import sys


try:
	from scribus import *
except ImportError:
	print "This script only runs from within Scribus."
	sys.exit(1)
		

if haveDoc():
	page = long(valueDialog('Begin','Where I begin ?')) 

	end = long(valueDialog('End','Where I stop ?'))
	xp = float(valueDialog('x value', 'Please give me an x value for even pages')) 
	yp = float(valueDialog('y value', 'Please give me an y value for even pages')) 
	wp = float(valueDialog('w value', 'Please give me an width value for even pages')) / mm 
	hp = float(valueDialog('h value', 'Please give me an height value for even pages')) / mm

	xi = float(valueDialog('x value', 'Please give me an x value for odd pages')) 
	yi = float(valueDialog('y value', 'Please give me an y value for odd pages')) 
	wi = float(valueDialog('w value', 'Please give me an width value for odd  pages')) / mm 
	hi = float(valueDialog('h value', 'Please give me an height value for odd  pages')) / mm
 	names=[]
	
	while page <= end :
		if page % 2 == 0 :
			try:
				gotoPage(page)
				names.append(createText(xp, yp, wp, hp))
				lockObject(names[-1])
			except  IndexError :
				break
		else:
			try:
				gotoPage(page)
				names.append(createText(xi, yi, wi, hi))
				lockObject(names[-1])
				
			except  IndexError :
				break
		page += 1

	for n in range(len(names) - 1) :
		try :
			linkTextFrames(names[n], names[n+1])
			
		except ScribusException :
			messageBox("Erreur", "Due to error, linking of text frames is left unfinished", ICON_WARNING )
			break


	
else:
        messageBox(TITLE, "No document open", ICON_WARNING)



=====================================================================================

I think it simple enough that you can change things to fit your needs. But it did the job here !

-- 
Pierre Marchand
JabberId : capparis at im.apinc.org

Dec  7 11:46:37 localhost ntpd[6595]: sendto(193.25.198.254): Invalid
argument




More information about the scribus mailing list