[scribus] Copy and Move Text Frame using API

Matt Miller matt.miller at fastmail.com
Tue Mar 9 19:19:13 UTC 2021


I'm trying to use the API to copy a text frame to a different page of the same document, then change the frame's name and position.  copyObjects() / pasteObjects() works for me to get the frame copied, but I'm not able to change the new frame's name.  I'm thinking to use getObjectAttributes() / setObjectAttributes() to change the new frame's name, but getObjectAttributes() always returns an empty list.  For example, I execute this from the scripter console:

dummy = newDocument((5, 3), (0, 0, 0, 0), PORTRAIT, 1, UNIT_INCHES, PAGE_1, 0, 2)
gotoPage (1)
orig_name = createText (1, 1, 1, 1)
copyObjects (orig_name)
gotoPage (2)
new_name = pasteObjects ()
new_attrs = getObjectAttributes (new_name[0])
print (len (new_attrs))

and that last print statement shows that the attribute list is empty.  I expected getObjectAttributes() to return a list of dictionary, and that I could then update the first (and only) dictionary in that list, changing the value of the "Name" element to the new name I want for the copied frame.

What's wrong with how I''m using the API here, and/or, is there another way to accomplish this?

Thanks.


--

  Matt Miller
  mailto:matt.miller at fastmail.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20210309/9c494c28/attachment.htm>


More information about the scribus mailing list