[scribus] Using valueDialog to generate pages

Gregory Pittman gpittman at iglou.com
Sat Nov 22 19:44:28 CET 2008


Emanuel Sprosec wrote:
> Hello to all,
>
> i've now played around a little bit with the possibilites of the console/scripts and generated sucessfully user-dialogs for a new layout, where the team-member can insert headline, text, select & insert an image and so on to make it more easier for them and provide a ready-made layout article-site.
>
> But i also tried to use a valueDialog to request how many pages the team-member want to start with his creativity. But i can't find a solution (with my absolut-no-exists-knowledge about python). First i tried to insert a valueDialog into the "newDocument" call  to replace the page-number with it. But it gives me an error "TypeError: an integer is required"... I read a little bit around and (think that i) understand that there is a gap between integer and string.
>
> Does anybody have a simple idea or advice, how to give the user via script a dialog, how many pages he wanted and to insert it or include it at the newDocument-call?
>   
Python itself is a bit fuzzy on strings vs. integers. On a practical 
level. the input from valueDialog will be considered a string.

so just put in for variable x:

x = int(x)

and python and Scribus should be happy.

The alternative is to deal with this as a string, with a structure such as

if x = '1' :

and so on.

Greg




More information about the scribus mailing list