On Tue, 2004-09-14 at 01:24, Dylan VanHerpen wrote: > Craig, it works great!
Cool. There's an updated version on the original URL, cleaned up, with better error checking etc. Hopefully. I can now run without any configuration and prompts for the information it needs. And there's a README ;-) http://www.postnewspapers.com.au/~craig/scribus/mailmerge.tar.bz2 The script has still received little testing - almost none with non-default prefs - so testing would be appreciated. Hopefully I haven't broken anything with the cleanups and changes. > Now my only question is: How do I print all the individual documents > that the script generated at once (as one job)? Can I modify the > script to merge each record to a new page within the same document? I suppose you could, at that. Frankly, I hadn't thought of that approach, but I don't see why not - if you can find a way to copy all the items on the page to a new one. I didn't spot a 'CopyObject' or similar function on a very quick glance at the API ref and the output of dir(). It's very late here now, though, so that means little. You should simply be able to make a copy of the mailmerge_writer_sla.py module and modify it to add a page instead of saving a new file then switch pages. Because Scribus requires unique object names across the document, you'll probably have to rename all the copied items as well. Unfortunately there doesn't appear to be a 'CopyPage()' function in the scripter to do the work for you yet, though the functionality is there in Scribus so it might not be a big job to add. Also, the current mailmerge_writer.py was written with individual files in mind (silly me), but you shouldn't need to alter it. Just use the 'self.path_prefix' and 'self.filename_prefix' as the full path and filename, eg os.path.join(self.path_prefix,self.filename_prefix), when doing your final document save. Alternately, don't call super() in __init__ at all, and don't bother to save the document - just leave it open when the script completes. If this didn't make much sense, don't worry - as I said, it's late here. I just hope the updated code makes more sense ;-) -- Craig Ringer
