CopyObject() and pasteObject()

This is an introduction to a couple of new Scripter commands. What these allow for is for the copying of selected objects (individually) to all or a number of pages. You might consider this as a workaround for the issue some have brought up regarding Master Pages, so that something occurring on a Master Page might be editable on individual pages.

These commands should soon become available in 1.5.0svn. There has long been a command duplicateObject, which makes one copy of a selected object, right on top of the object. Inside the workings of the command, what happens is that the object is copied to the clipboard, then immediately pasted.

To create these two new commands, these two functions were simply split up and separate commands created. What this allows you to do is to first copy an object, then paste it on some other page. Just as with copy and paste in the main Scribus window, an object pasted from the clipboard is assigned the same page coordinates as the original.

The first script below uses these commands to copy a selected object to all pages, odd pages, or even pages. If you specify anything else, nothing happens. The second script asks for a list of page numbers to paste your object to.

paste2pagelist.py
This second script allows you to enter a list of pages by page number, separated by space. You will find this one also on the feature request page.

There is a check to make sure all of your numbers are within the correct range, but the list doesn't have to be in any particular order.