Using the new applyMasterPage() command

Here are two scripts which make use of the new applyMasterPage command now in 1.4.5svn and 1.5.0svn versions of Scribus.

Both of them take some of their structure from paste2pagelist.py and paste2all.py, which were written for the recently added copyObject and pasteObject commands. They will allow only one Master Page to be assigned at a time, so run them sequentially to make other assignments.

Note: I have removed the editMasterPage command from the scripts, since the former problem has been resolved.

assignMP.py
The script now has the ability to allow an entry of a range, using a hyphen. For example, '1 3-6 9 11', will be expanded to '1 3 4 5 6 9 11'. To make it more complete, you can now enter pages to skip in a third valueDialog, which could make some sense only if you used a range in your list of pages to apply the MP to. Since there are two situations where we might have ranges for input, I created the expand_pages function at the beginning.

assignMP2all.py
Here is another script, this time approaching the issue as if you might want to apply a Master Page to all pages, even pages, odd pages, or maybe even something more esoteric like the 4th out of every 9 pages. If you make a mistake in entry, the script runs and nothing happens, the exception perhaps if you might do something like 9/3.

In addition, there is an additional dialog which asks for a list of pages to skip, in case for example, you want to apply the MP to the even pages, except for page 10, or maybe the range of pages 10-16.

Something you may notice with the input for the list of pages to skip is that I don't test to see if the list contains pages outside the range of the document. This is unnecessary, since it won't affect the running of the script if you check the skip list for such pages.