Mantis Issue Tracking for Scribus
· Hosting provided by / Øverby Consulting ·

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010560ScribusScripterpublic2012-01-31 19:202014-08-21 01:35
Assigned Toplinnell 
PlatformOSOS Version
Product Version1.4.1.svn 
Target VersionFixed in Version1.5.0svn 
Summary0010560: two new Scripter commands: copyObject() and pasteObject()
DescriptionThese two new commands represent a simple splitting of the functions already contained in duplicateObject(), so that one can first copy an object to the clipboard, then later in a script paste.
What this allows for is switching pages between copying and pasting, and first copying then pasting to multiple pages.
Additional InformationThe uploaded file contains the necessary modified files for the scripter plugin, and also the appropriate documentation page to go into doc/en/

I have also made a script using these commands, and created a wiki page: [^]

to illustrate its usage. I plan to develop the script to be more flexible, such as being able specify specific pages to paste to.

Incidentally, the original duplicateObject() command does NOT work for a selected group.
TagsNo tags attached.
Attached Filestar file icon cmdobj.tar [^] (112,640 bytes) 2012-01-31 19:20
? file icon [^] (2,302 bytes) 2012-01-31 19:24
? file icon [^] (2,212 bytes) 2012-03-23 01:36
? file icon patchfile [^] (4,968 bytes) 2014-06-15 04:07 [Show Content]

- Relationships

-  Notes
gpittman (developer)
2012-01-31 19:25
edited on: 2012-01-31 21:40

I've uploaded the script here also, since I find that copying and pasting scripts from the wiki isn't always so easy.

gpittman (developer)
2012-03-23 01:37

I have now added another script,, which allows you to paste to a list of pages entered in a valueDialog. There is error checking to make sure all page numbers are in the correct range.
cbradney (administrator)
2014-06-03 22:18

Greg.. can you perhaps create diffs against current SVN for 1.5 and I will commit these?
gpittman (developer)
2014-06-09 18:02

I've started looking at this.
One issue of course is that these were created for 1.4.1, and even so, 1.4.4 has a lot of mods since 2012.

Nonetheless, I can still go back and make the necessary mods to 1.5.0svn, then submit the patch. My plan will be to only submit here the changes for cmdobject.h, cmdobject.cpp, and scriptplugin.cpp. I can commit the doc changes myself once the code is committed.
gpittman (developer)
2014-06-15 04:06
edited on: 2014-06-15 04:12

Ok, I've gone through the old files, and inserted necessary parts to the 1.5.0 code.
Am uploading a patchfile.

I've checked this out with my scripts and and seems to work fine. These are on the wiki page linked to above in this bug report.

gpittman (developer)
2014-06-15 04:25
edited on: 2014-06-15 04:27

Something I just discovered is that the scripts DO work with a selected group!
Perhaps something in 1.5.0 corrected this former problem.

I'll update the wiki page once this patch is committed.

ale (manager)
2014-06-16 08:14

just one note: i see this as a potential "dangerous" command.

people will copy in a loop and paste afterwards... wondering why they're only getting the last element.

personally, from a programming point of view, i would prefer not to have this in, but (if needed) improve the duplication and placement of the items.

the workflow in a program should in my eyes be: duplicate and keep a reference to the new item. when you're ready move the referenced item to the new page / place.
copying an item to the scrapbook and getting it back from there seems to be very inflexible to me, when i can reference items with variables...

... of course, i might ignore a use case that does not fit the duplicate and move model :-) if there is one, then the copy paste is also ok!
gpittman (developer)
2014-06-16 13:49
edited on: 2014-06-16 13:59

Just because a command exists doesn't mean it must be used. I think the scripts I wrote demonstrate the utility of these commands.

Trials have shown using the scripts that I wrote show that the script is undoable - you just repeatedly Undo to remove copies from last to first.

I don't understand the danger -- you copy to the clipboard, then paste one or multiple times. Why someone would serially copy objects then later try to paste them serially makes no sense to me.

There are more dangerous commands than these.

copyObject() is the same as pressing Ctrl-C
pasteObject() the same as Ctrl-V

ale (manager)
2014-06-17 11:22

as far as i know, there is nothing like ctrl-c and ctrl-v as such in programming.
... there must be good reasons for it...
(even if languages like actionscript might implement it... :-)

for sure, i see the reasons why you like to have those commands.

but i still prefer not to have those in the scripter API: the main reason being that using duplicate and references to the created objects, allows python to catch some of the possible errors.

while copy/paste is wonderful for simple cases, it might fail in unexpected and hard to debug ways in more complicated scripts:

def do_something:


this is imo a very common -- even if not 100% clean -- pattern for scripts that are duplicating content.
and it will fail :-(
and it will be hard to spot if you script is a few dozens of lines long...
ale (manager)
2014-06-17 11:38
edited on: 2014-06-17 13:19

p.s.: it's clear, not because the scripter gets copy / paste that it will be a bad scripter... but i would not add "dangerous" commands, when alternatives already exist, that are almost as simple and safer...

i would rather well document how to do copy paste with the existing duplicate command...

gpittman (developer)
2014-06-17 19:12

1. copy-paste with duplicate isn't possible. It's why I submitted this feature request.

2. I am still trying to understand why you are attacking this feature. Please show us a script that causes the havoc you envision.

do something
is not a functioning script. You seem to be trying to file a bug report on this not-yet-included feature, but without any concrete example of how you see it failing. Can you write such a script for us to examine?
ale (manager)
2014-06-17 20:37

greg, i'm sorry, that your are feeling that i'm attacking this feature.

i have looked a bit deeper into the issue and indeed scribus seems to be missing a command: moving an object to a specific page.

JLuc (developer)
2014-07-06 19:01

Ale : they are such commands that go very much like copy 'n' paste in various languages : its push and pull. Push some object on a stack, and pull it back when needed. For some languages as forth, its the main data management process.
Kunda (manager)
2014-07-10 00:24

Reminder sent to: gpittman

Is this merged in to trunk and resolved?
gpittman (developer)
2014-07-10 03:31

Commands have been added to 1.5.0svn
Kunda (manager)
2014-07-21 02:25


- Issue History
Date Modified Username Field Change
2012-01-31 19:20 gpittman New Issue
2012-01-31 19:20 gpittman File Added: cmdobj.tar
2012-01-31 19:24 gpittman File Added:
2012-01-31 19:25 gpittman Note Added: 0027636
2012-01-31 21:40 gpittman Note Edited: 0027636 View Revisions
2012-03-23 01:36 gpittman File Added:
2012-03-23 01:37 gpittman Note Added: 0027850
2012-05-30 01:40 plinnell Assigned To => plinnell
2012-05-30 01:40 plinnell Status new => assigned
2014-06-03 22:18 cbradney Note Added: 0031982
2014-06-09 18:02 gpittman Note Added: 0032058
2014-06-15 04:06 gpittman Note Added: 0032169
2014-06-15 04:07 gpittman File Added: patchfile
2014-06-15 04:12 gpittman Note Edited: 0032169 View Revisions
2014-06-15 04:12 gpittman Note Edited: 0032169 View Revisions
2014-06-15 04:25 gpittman Note Added: 0032170
2014-06-15 04:27 gpittman Note Edited: 0032170 View Revisions
2014-06-16 08:14 ale Note Added: 0032194
2014-06-16 13:49 gpittman Note Added: 0032196
2014-06-16 13:59 gpittman Note Edited: 0032196 View Revisions
2014-06-17 11:22 ale Note Added: 0032212
2014-06-17 11:38 ale Note Added: 0032213
2014-06-17 13:19 ale Note Edited: 0032213 View Revisions
2014-06-17 19:12 gpittman Note Added: 0032222
2014-06-17 20:37 ale Note Added: 0032223
2014-07-06 19:01 JLuc Note Added: 0032501
2014-07-10 00:24 Kunda Note Added: 0032639
2014-07-10 03:31 gpittman Note Added: 0032646
2014-07-10 03:31 gpittman Status assigned => resolved
2014-07-10 03:31 gpittman Fixed in Version => 1.5.0
2014-07-10 03:31 gpittman Resolution open => fixed
2014-07-21 02:25 Kunda Note Added: 0032853
2014-07-21 02:25 Kunda Status resolved => closed
2014-08-21 01:35 jghali Fixed in Version 1.5.0 => 1.5.0svn

Copyright © 2000 - 2015 MantisBT Team
Powered by Mantis Bugtracker