[scribus] identifying grouped object with the scripter

big.bros at free.fr big.bros at free.fr
Fri Apr 24 08:41:49 UTC 2015


Hi,

> somehow i have the feeling that you're not going for the easiest way...

I'd be glad if someone has an idea to make it a better way than mine. Right now, i can't think of one.

What i want to achieve is very clear to me :

It's about books
I have csv files with all the datas (author, title, price...)... That is 200 or 300 lines per file
I also have a set of image files for the covers.

To have the "best" design (and this is a important point, it's not just listing the books), i need to do define a block for one book by hand, directly in scribus, and maybe some other blocks for theme titles or others...
Then, duplicate the block as many times as i have rows in my csv file, change the text, change the image location and place it where i need to place it.

For me, this seems the natural and easy way. If navigating in groups and duplicating objects (better : duplicating groups including objects ( :-) ) on different pages were possible it would already be done in less than one day.
I can't see how you could do this easier.
As you say, it's close to what i would do with the mouse but i don't know what you mean by thinking more like a programmer (this is what i am in fact. The design is done by someone else).

I've already done a POC in the scripter that works very well (and is rather short) as far as i don't need to define different blocks for a normal book, a theme title and so on (which i could get round by naming objects in a known way but i find this tedious), and as far as i only have one page (this is much more annoying). So this is not completely OK. The copy/paste on different pages will be possible with 1.5 so i will probably use the scripter when this version will be out.

Till then, I think xml will be simpler (i'm used to work with python and xml) than creating objects, retrieving all the properties (many many methods to call - maybe possible a simple way with getPropertyNames()... I'll give a try), and juggle between the template page and the current one...

So, I'm confident in the end. Even if the xml way is not a very good one, it is sure everything i need is contained in. It is just a little more work as i have to re-wrap the page objects.

Anyway, thanks again for all thos work. I have looked around to see what tool would allow to automate something like this and, even if it's not perfect in some aspects, scribus is the best choice i found for it (as i already know python, i know how to deal with xml (even if it's not the preferred choice))... I'm sure i can achieve it even if it's a little more dev than thought at first glance.

Have a nice day,
Jice


----- Mail original -----
De: "ale rimoldi" <ale.comp_06 at xox.ch>
À: scribus at lists.scribus.net
Envoyé: Vendredi 24 Avril 2015 09:21:24
Objet: Re: [scribus] identifying grouped object with the scripter

hi big,


> You're right : I'm trying to make a script to automate the making of a
> catalog.

somehow i have the feeling that you're not going for the easiest way...

your trials with the scripts look like you're staying very close to
what you would be doing with the mouse... but you might have an easier
life if you would think more like a programmer, here.

the scripter shipped with scribus 1.4 is not perfect for creating a
catalog, but with a bit of luck (and creativity) you should be able to
get it to work.
other people have already done it, afaik.


i still don't know much about the details of your project, but i have
the feeling that you should better define what you want to achieve...

have a nice day
a.l.e

___
Scribus Mailing List: scribus at lists.scribus.net
Edit your options or unsubscribe:
http://lists.scribus.net/mailman/listinfo/scribus
See also:
http://wiki.scribus.net
http://forums.scribus.net



More information about the scribus mailing list