Scribus Forums

Scribus => Scripts and Plugins => Topic started by: iKay on July 26, 2011, 08:06:42 PM

Title: Problem with API duplicateObject
Post by: iKay on July 26, 2011, 08: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
Title: Re: Problem with API duplicateObject
Post by: a.l.e on July 27, 2011, 04: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!)
Title: Re: Problem with API duplicateObject
Post by: Wena on July 27, 2011, 10:32:49 PM
I am new to all this, what is an API?

Wena
Title: Re: Problem with API duplicateObject
Post by: Nermander on July 28, 2011, 07:39:29 AM
Never tried using google to find answers? :)

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