Scribusoid

Author Topic: API - select all and copy all objects  (Read 50 times)

digirew

  • Newbie
  • *
  • Posts: 30
  • Karma: 0
  • Scribus User
API - select all and copy all objects
« on: September 16, 2020, 08:59:33 pm »
Is it possible to select all objects on a page and copy/paste them into another document? (in a script and not in the program interface itself).

I can see that the copy/paste functions are present, but it seems like I can only do one object at a time?




a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2418
  • Karma: 35
    • the graphics lab
Re: API - select all and copy all objects
« Reply #1 on: September 16, 2020, 10:56:37 pm »
indeed it can only copy one item at a time.

i've opened a ticket to ask for the reason.

without thinking too much i see two workarounds:

- copying one item at a time should be doable. if you turn out the screen refreshing it should not even be really much slower.
- you can group the items in the selection, copy them and then ungroup them again (if you have many items to copy, i would probably group them any way)

i would expect that future versions of scribus will be able to copy multiple items from a script, but the workarounds should be good enough to get your script to work : - )

ciao
a.l.e

digirew

  • Newbie
  • *
  • Posts: 30
  • Karma: 0
  • Scribus User
Re: API - select all and copy all objects
« Reply #2 on: September 17, 2020, 07:23:21 pm »
thanks a.l.e,

the second approach what you mentioned is what I have been doing, but was hoping for a more elegant way. Will need to do more testing but it does seem to do the job so far!