Author Topic: Problem with API duplicateObject  (Read 3444 times)

iKay

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Problem with API duplicateObject
« on: July 26, 2011, 09:06:42 pm »
In my attempt to do some automation on scribus, I find that, the API duplicateObject() is not returning me the name of the duplicated object, though the document mentions it returs a string. Is it expected to return the name of the duplicated object? - I am getting None as return.

I am using 1.4.0 RC3 - Can somebody please clarify?

Thanks
iKay

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2177
  • Karma: 28
    • the graphics lab
Re: Problem with API duplicateObject
« Reply #1 on: July 27, 2011, 05:47:40 pm »
well, the API does not say it will return the name of the created object...

but i agree with you that it should do it!

could you please fill a feature request to make sure that it will be done in the new scripter engine (which is currently being finished...)

for the time being, you can use the following workardound:

<pre>
scribus.duplicateObject();
newItem =  scribus.getSelectedObject();
</pre>

... after duplicating the item, scribus automatically selects the newly created one... (which is or is not what it should do... imo, it should not to do it, since it's a side effect... a mostly welcome one, but still a side effect!)

Wena

  • Full Member
  • ***
  • Posts: 179
  • Karma: 0
Re: Problem with API duplicateObject
« Reply #2 on: July 27, 2011, 11:32:49 pm »
I am new to all this, what is an API?

Wena

Nermander

  • Hero Member
  • *****
  • Posts: 1316
  • Karma: 17
Re: Problem with API duplicateObject
« Reply #3 on: July 28, 2011, 08:39:29 am »
Never tried using google to find answers? :)

http://en.wikipedia.org/wiki/Application_Programming_Interface

 

palmate